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
This commit is contained in:
J. Alexander Treuman 2006-12-23 15:22:35 +00:00
parent f158016d0e
commit 57b0a42940

View File

@ -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) {