]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Do not discard mp3 frames in the parser after a broken frame.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 5 May 2009 13:46:50 +0000 (13:46 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 5 May 2009 13:46:50 +0000 (13:46 +0000)
Fixes issue1044.
This may cause regressions with broken streams, if you find any, please report!

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18741 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/mpegaudio_parser.c

index 47a78df5b0813e1b007ebe805ed4b41b9057bdab..cc2d240abdb44beb210f7004c89fde966dc4dd62 100644 (file)
@@ -223,10 +223,8 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
 
         if(s->frame_size > 0 && buf_ptr - buf == s->inbuf_ptr - s->inbuf
            && buf_size + buf_ptr - buf >= s->frame_size){
-            if(s->header_count > 0){
                 *poutbuf = buf;
                 *poutbuf_size = s->frame_size;
-            }
             buf_ptr = buf + s->frame_size;
             s->inbuf_ptr = s->inbuf;
             s->frame_size = 0;
@@ -236,10 +234,8 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
         //    next_data:
         if (s->frame_size > 0 &&
             (s->inbuf_ptr - s->inbuf) >= s->frame_size) {
-            if(s->header_count > 0){
                 *poutbuf = s->inbuf;
                 *poutbuf_size = s->inbuf_ptr - s->inbuf;
-            }
             s->inbuf_ptr = s->inbuf;
             s->frame_size = 0;
             break;