lets SKIP all recorable stream errors

git-svn-id: https://svn.musicpd.org/mpd/trunk@200 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-03-05 12:48:57 +00:00
parent 4e4faf6174
commit db82d2fc8c
1 changed files with 6 additions and 8 deletions

View File

@ -188,8 +188,8 @@ int decodeNextFrameHeader(mp3DecodeData * data) {
} }
} }
if(mad_header_decode(&data->frame.header,&data->stream)) { if(mad_header_decode(&data->frame.header,&data->stream)) {
if((data->stream).error==MAD_ERROR_LOSTSYNC) {
#ifdef HAVE_ID3TAG #ifdef HAVE_ID3TAG
if((data->stream).error==MAD_ERROR_LOSTSYNC) {
signed long tagsize = id3_tag_query( signed long tagsize = id3_tag_query(
(data->stream).this_frame, (data->stream).this_frame,
(data->stream).bufend- (data->stream).bufend-
@ -198,10 +198,9 @@ int decodeNextFrameHeader(mp3DecodeData * data) {
mad_stream_skip(&(data->stream),tagsize); mad_stream_skip(&(data->stream),tagsize);
return DECODE_CONT; return DECODE_CONT;
} }
#endif
return DECODE_SKIP;
} }
if(MAD_RECOVERABLE((data->stream).error)) return DECODE_CONT; #endif
if(MAD_RECOVERABLE((data->stream).error)) return DECODE_SKIP;
else { else {
if((data->stream).error==MAD_ERROR_BUFLEN) return DECODE_CONT; if((data->stream).error==MAD_ERROR_BUFLEN) return DECODE_CONT;
else else
@ -224,9 +223,9 @@ int decodeNextFrame(mp3DecodeData * data) {
return DECODE_BREAK; return DECODE_BREAK;
} }
} }
#ifdef HAVE_ID3TAG
if(mad_frame_decode(&data->frame,&data->stream)) { if(mad_frame_decode(&data->frame,&data->stream)) {
if((data->stream).error==MAD_ERROR_LOSTSYNC) { if((data->stream).error==MAD_ERROR_LOSTSYNC) {
#ifdef HAVE_ID3TAG
signed long tagsize = id3_tag_query( signed long tagsize = id3_tag_query(
(data->stream).this_frame, (data->stream).this_frame,
(data->stream).bufend- (data->stream).bufend-
@ -235,10 +234,9 @@ int decodeNextFrame(mp3DecodeData * data) {
mad_stream_skip(&(data->stream),tagsize); mad_stream_skip(&(data->stream),tagsize);
return DECODE_CONT; return DECODE_CONT;
} }
#endif
return DECODE_SKIP;
} }
if(MAD_RECOVERABLE((data->stream).error)) return DECODE_CONT; #endif
if(MAD_RECOVERABLE((data->stream).error)) return DECODE_SKIP;
else { else {
if((data->stream).error==MAD_ERROR_BUFLEN) return DECODE_CONT; if((data->stream).error==MAD_ERROR_BUFLEN) return DECODE_CONT;
else else