mpegaudio_parser: Don't ignore information from the first frame
authorAlexander Kojevnikov <alexander@kojevnikov.com>
Thu, 7 Mar 2013 05:58:59 +0000 (21:58 -0800)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 7 Mar 2013 22:07:04 +0000 (23:07 +0100)
Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegaudio_parser.c

index bb4d75c..4081936 100644 (file)
@@ -75,6 +75,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
                     if((state&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
                         s->header_count= -3;
                     s->header= state;
+                    s->header_count++;
                     s->frame_size = ret-4;
 
                     if (s->header_count > 0) {
@@ -86,7 +87,6 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
                             avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
                         }
                     }
-                    s->header_count++;
                     break;
                 }
             }