[FFmpeg-devel] [PATCH] mpegaudio_parser: Don't ignore information from the first frame

Alexander Kojevnikov alexander at kojevnikov.com
Thu Mar 7 07:10:54 CET 2013


This change was originally introduced in 0b8b7db but then subsequently
lost when resolving merge conflicts. This should tell the full story:

% git log -m -u -- libavcodec/mpegaudio_parser.c
-------------- next part --------------
From 72eed8f6d8c9bfe5a00ebe5b0d3d7b77a4f80f3e Mon Sep 17 00:00:00 2001
From: Alexander Kojevnikov <alexander at kojevnikov.com>
Date: Wed, 6 Mar 2013 21:58:59 -0800
Subject: [PATCH] mpegaudio_parser: Don't ignore information from the first
 frame

Signed-off-by: Alexander Kojevnikov <alexander at kojevnikov.com>
---
 libavcodec/mpegaudio_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c
index bb4d75c..4081936 100644
--- a/libavcodec/mpegaudio_parser.c
+++ b/libavcodec/mpegaudio_parser.c
@@ -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;
                 }
             }
-- 
1.8.1.3


More information about the ffmpeg-devel mailing list