break if error in header so it can output already decoded frames
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 26 Apr 2008 14:41:29 +0000 (14:41 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 26 Apr 2008 14:41:29 +0000 (14:41 +0000)
Originally committed as revision 12999 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegaudiodec.c

index 108b745..9b22014 100644 (file)
@@ -2591,10 +2591,8 @@ static int decode_frame_mp3on4(AVCodecContext * avctx,
 
         header = (AV_RB32(buf) & 0x000fffff) | s->syncword; // patch header
 
-        if (ff_mpa_check_header(header) < 0) { // Bad header, discard block
-            *data_size = 0;
-            return buf_size;
-        }
+        if (ff_mpa_check_header(header) < 0) // Bad header, discard block
+            break;
 
         ff_mpegaudio_decode_header(m, header);
         out_size += mp_decode_frame(m, outptr, buf, fsize);