Commit 57b0a429 authored by J. Alexander Treuman's avatar J. Alexander Treuman

Don't stop decoding if we're at maxFrames just because there's a Xing tag.

Instead, stop decoding as soon as we've found the frames/samples at the "end" that we want drop. git-svn-id: https://svn.musicpd.org/mpd/trunk@5149 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent f158016d
......@@ -759,8 +759,6 @@ static int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc,
mad_timer_add(&data->timer, (data->frame).header.duration);
data->bitRate = (data->frame).header.bitrate;
if (data->currentFrame >= data->maxFrames) {
/* stop decoding, since Xing maxFrames is accurate */
if (data->foundXing) return DECODE_BREAK;
data->currentFrame = data->maxFrames - 1;
} else {
data->highestFrame++;
......@@ -811,8 +809,9 @@ static int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc,
break;
} else if ((data->dropFramesAtEnd > 0) &&
(data->currentFrame == (data->maxFrames + 1 - data->dropFramesAtEnd))) {
data->dropFramesAtEnd--;
break;
/* stop decoding, effectively dropping all remaining
* frames */
return DECODE_BREAK;
}
if (data->inStream->metaTitle) {
......
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