[FFmpeg-cvslog] lavc/aac_ac3_parser: avoid zeroing codec parameters if we haven' t read a frame

Rodger Combs git at videolan.org
Sat Feb 27 23:32:00 CET 2016


ffmpeg | branch: master | Rodger Combs <rodger.combs at gmail.com> | Tue Nov 24 03:20:09 2015 -0600| [9f5baf90856f8afa0d94c2bf1dc31f485ef72a13] | committer: Rodger Combs

lavc/aac_ac3_parser: avoid zeroing codec parameters if we haven't read a frame

This caused issues when seeking in some unusual MPEGTS files

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f5baf90856f8afa0d94c2bf1dc31f485ef72a13
---

 libavcodec/aac_ac3_parser.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index 2f7d568..6a76eb8 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -34,6 +34,7 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1,
     ParseContext *pc = &s->pc;
     int len, i;
     int new_frame_start;
+    int got_frame = 0;
 
 get_next:
     i=END_NOT_FOUND;
@@ -51,6 +52,7 @@ get_next:
             if(len<=0){
                 i=END_NOT_FOUND;
             }else{
+                got_frame = 1;
                 s->state=0;
                 i-= s->header_size -1;
                 s->remaining_size = len;
@@ -76,6 +78,7 @@ get_next:
     if(s->codec_id)
         avctx->codec_id = s->codec_id;
 
+    if (got_frame) {
     /* Due to backwards compatible HE-AAC the sample rate, channel count,
        and total number of samples found in an AAC ADTS header are not
        reliable. Bit rate is still accurate because the total frame duration in
@@ -101,6 +104,7 @@ get_next:
     }
 
     avctx->bit_rate = s->bit_rate;
+    }
 
     return i;
 }



More information about the ffmpeg-cvslog mailing list