From 4fe965c3044888bafa6c86e40724c20faa16f972 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Sun, 13 Aug 2006 02:56:23 +0000 Subject: 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 --- src/inputPlugins/mp3_plugin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/inputPlugins') diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 6211ce085..f2329d25a 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -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; -- cgit v1.2.3