diff options
author | J. Alexander Treuman <jat@spatialrift.net> | 2006-12-23 15:22:35 +0000 |
---|---|---|
committer | J. Alexander Treuman <jat@spatialrift.net> | 2006-12-23 15:22:35 +0000 |
commit | 57b0a429407a57cee17f159c6af7db9d6d937c91 (patch) | |
tree | 9ae622784e408199320e446c8884713eec632522 /src/inputPlugins | |
parent | f158016d0e2a54a4694ad4624a5ba35eae49a3b9 (diff) | |
download | mpd-57b0a429407a57cee17f159c6af7db9d6d937c91.tar.gz mpd-57b0a429407a57cee17f159c6af7db9d6d937c91.tar.xz mpd-57b0a429407a57cee17f159c6af7db9d6d937c91.zip |
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
Diffstat (limited to '')
-rw-r--r-- | src/inputPlugins/mp3_plugin.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 9434489bc..b2279b29e 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -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) { |