Stop decoding once we've dropped samples at the end (it messes up the audio if there's more mp3 to decode)

git-svn-id: https://svn.musicpd.org/mpd/trunk@4619 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2006-08-13 02:56:23 +00:00
parent 66512edb6c
commit 4fe965c304

View File

@ -822,7 +822,9 @@ static int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc,
} else if (data->dropSamplesAtEnd &&
(data->currentFrame == (data->maxFrames - data->dropFramesAtEnd))) {
samplesLeft--;
if (samplesLeft < data->dropSamplesAtEnd) break;
/* stop decoding, since samples were dropped */
if (samplesLeft < data->dropSamplesAtEnd)
return DECODE_BREAK;
}
sample = (mpd_sint16 *) data->outputPtr;