Commit 1cf07bfa authored by Warren Dukes's avatar Warren Dukes

skip over all bad frames

git-svn-id: https://svn.musicpd.org/mpd/trunk@203 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 170824db
...@@ -424,6 +424,7 @@ int mp3Read(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) { ...@@ -424,6 +424,7 @@ int mp3Read(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) {
static int i; static int i;
static int ret; static int ret;
static struct audio_dither dither; static struct audio_dither dither;
static int skip;
if(data->currentFrame>=data->highestFrame && if(data->currentFrame>=data->highestFrame &&
data->highestFrame<data->maxFrames) data->highestFrame<data->maxFrames)
...@@ -501,15 +502,18 @@ int mp3Read(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) { ...@@ -501,15 +502,18 @@ int mp3Read(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) {
} }
} }
if(data->muteFrame) { while(1) {
while((ret=decodeNextFrameHeader(data))==DECODE_CONT || skip = 0;
ret==DECODE_SKIP); while((ret = decodeNextFrameHeader(data))==DECODE_CONT);
} if(ret==DECODE_SKIP) skip = 1;
else { else if(ret==DECODE_BREAK) return -1;
while((ret=decodeNextFrame(data))==DECODE_CONT || if(data->muteFrame) {
ret==DECODE_SKIP); while((ret = decodeNextFrame(data))==DECODE_CONT);
if(ret==DECODE_BREAK) return -1;
}
if(!skip && ret==DECODE_OK) break;
} }
return ret; return ret;
} }
......
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