skip over all bad frames
git-svn-id: https://svn.musicpd.org/mpd/trunk@203 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
170824db8c
commit
1cf07bfa40
|
@ -424,6 +424,7 @@ int mp3Read(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) {
|
|||
static int i;
|
||||
static int ret;
|
||||
static struct audio_dither dither;
|
||||
static int skip;
|
||||
|
||||
if(data->currentFrame>=data->highestFrame &&
|
||||
data->highestFrame<data->maxFrames)
|
||||
|
@ -501,13 +502,16 @@ int mp3Read(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) {
|
|||
}
|
||||
}
|
||||
|
||||
if(data->muteFrame) {
|
||||
while((ret=decodeNextFrameHeader(data))==DECODE_CONT ||
|
||||
ret==DECODE_SKIP);
|
||||
}
|
||||
else {
|
||||
while((ret=decodeNextFrame(data))==DECODE_CONT ||
|
||||
ret==DECODE_SKIP);
|
||||
while(1) {
|
||||
skip = 0;
|
||||
while((ret = decodeNextFrameHeader(data))==DECODE_CONT);
|
||||
if(ret==DECODE_SKIP) skip = 1;
|
||||
else if(ret==DECODE_BREAK) return -1;
|
||||
if(data->muteFrame) {
|
||||
while((ret = decodeNextFrame(data))==DECODE_CONT);
|
||||
if(ret==DECODE_BREAK) return -1;
|
||||
}
|
||||
if(!skip && ret==DECODE_OK) break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue