Commit a0a74951 authored by Max Kellermann's avatar Max Kellermann

decoder/mad: eliminate attribute "bit_rate"

This also fixes a bug which caused the bit rate to not update after seeking.
parent 779a6855
ver 0.21.12 (not yet released) ver 0.21.12 (not yet released)
* decoder * decoder
- mad: update bit rate after seeking
- opus: ignore case in replay gain tag names - opus: ignore case in replay gain tag names
- opus, vorbis: decode the "end of stream" packet - opus, vorbis: decode the "end of stream" packet
* output * output
......
...@@ -132,7 +132,6 @@ struct MadDecoder { ...@@ -132,7 +132,6 @@ struct MadDecoder {
bool found_replay_gain = false; bool found_replay_gain = false;
bool found_first_frame = false; bool found_first_frame = false;
bool decoded_first_frame = false; bool decoded_first_frame = false;
unsigned long bit_rate;
DecoderClient *const client; DecoderClient *const client;
InputStream &input_stream; InputStream &input_stream;
enum mad_layer layer = mad_layer(0); enum mad_layer layer = mad_layer(0);
...@@ -788,7 +787,6 @@ MadDecoder::UpdateTimerNextFrame() noexcept ...@@ -788,7 +787,6 @@ MadDecoder::UpdateTimerNextFrame() noexcept
if (current_frame >= highest_frame) { if (current_frame >= highest_frame) {
/* record this frame's properties in frame_offsets /* record this frame's properties in frame_offsets
(for seeking) and times */ (for seeking) and times */
bit_rate = frame.header.bitrate;
if (current_frame >= max_frames) if (current_frame >= max_frames)
/* cap current_frame */ /* cap current_frame */
...@@ -829,7 +827,7 @@ MadDecoder::SendPCM(unsigned i, unsigned pcm_length) noexcept ...@@ -829,7 +827,7 @@ MadDecoder::SendPCM(unsigned i, unsigned pcm_length) noexcept
auto cmd = client->SubmitData(input_stream, output_buffer, auto cmd = client->SubmitData(input_stream, output_buffer,
sizeof(output_buffer[0]) * num_samples, sizeof(output_buffer[0]) * num_samples,
bit_rate / 1000); frame.header.bitrate / 1000);
if (cmd != DecoderCommand::NONE) if (cmd != DecoderCommand::NONE)
return cmd; return cmd;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment