[FFmpeg-cvslog] r12759 - in trunk/libavcodec: aac_ac3_parser.c aac_ac3_parser.h aac_parser.c ac3_parser.c

bwolowiec subversion
Mon Apr 7 22:54:08 CEST 2008


Author: bwolowiec
Date: Mon Apr  7 22:54:08 2008
New Revision: 12759

Log:
Corrections of errors in aac_ac3_parser


Modified:
   trunk/libavcodec/aac_ac3_parser.c
   trunk/libavcodec/aac_ac3_parser.h
   trunk/libavcodec/aac_parser.c
   trunk/libavcodec/ac3_parser.c

Modified: trunk/libavcodec/aac_ac3_parser.c
==============================================================================
--- trunk/libavcodec/aac_ac3_parser.c	(original)
+++ trunk/libavcodec/aac_ac3_parser.c	Mon Apr  7 22:54:08 2008
@@ -44,13 +44,19 @@ int ff_aac_ac3_parse(AVCodecParserContex
                 if((len=s->sync(s->state, s, &s->need_next_header, &s->new_frame_start)))
                     break;
             }
-            i-= s->header_size;
+            i-= s->header_size -1;
             if(len>0){
                 s->remaining_size = len + i;
 
                 if(pc->index+i > 0 && s->new_frame_start){
                     s->remaining_size -= i; // remaining_size=len
 output_frame:
+                    if(!s->frame_in_buffer && 0){
+                        s->frame_in_buffer=1;
+                        buf+=i;
+                        buf_size-=i;
+                        continue;
+                    }
                     ff_combine_frame(pc, i, &buf, &buf_size);
                     *poutbuf = buf;
                     *poutbuf_size = buf_size;
@@ -72,6 +78,7 @@ output_frame:
 
                     return i;
                 }
+                s->frame_in_buffer=1;
             }else{
                 break;
             }

Modified: trunk/libavcodec/aac_ac3_parser.h
==============================================================================
--- trunk/libavcodec/aac_ac3_parser.h	(original)
+++ trunk/libavcodec/aac_ac3_parser.h	Mon Apr  7 22:54:08 2008
@@ -43,6 +43,7 @@ typedef struct AACAC3ParseContext {
 
     int need_next_header;
     int new_frame_start;
+    int frame_in_buffer;
 } AACAC3ParseContext;
 
 int ff_aac_ac3_parse(AVCodecParserContext *s1,

Modified: trunk/libavcodec/aac_parser.c
==============================================================================
--- trunk/libavcodec/aac_parser.c	(original)
+++ trunk/libavcodec/aac_parser.c	Mon Apr  7 22:54:08 2008
@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACA
     int size, rdb, ch, sr;
     uint64_t tmp = be2me_64(state);
 
-    init_get_bits(&bits, (uint8_t *)&tmp, AAC_HEADER_SIZE * 8);
+    init_get_bits(&bits, ((uint8_t *)&tmp)+8-AAC_HEADER_SIZE, AAC_HEADER_SIZE * 8);
 
     if(get_bits(&bits, 12) != 0xfff)
         return 0;

Modified: trunk/libavcodec/ac3_parser.c
==============================================================================
--- trunk/libavcodec/ac3_parser.c	(original)
+++ trunk/libavcodec/ac3_parser.c	Mon Apr  7 22:54:08 2008
@@ -130,7 +130,7 @@ static int ac3_sync(uint64_t state, AACA
     uint64_t tmp = be2me_64(state);
     AC3HeaderInfo hdr;
 
-    err = ff_ac3_parse_header((uint8_t *)&tmp, &hdr);
+    err = ff_ac3_parse_header(((uint8_t *)&tmp)+8-AC3_HEADER_SIZE, &hdr);
 
     if(err < 0)
         return 0;




More information about the ffmpeg-cvslog mailing list