[FFmpeg-cvslog] r18814 - in trunk/libavcodec: aac_parser.c aac_parser.h

alexc subversion
Wed May 13 16:11:12 CEST 2009


Author: alexc
Date: Wed May 13 16:11:11 2009
New Revision: 18814

Log:
Move the ADTS header size to the parser's header file.

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

Modified: trunk/libavcodec/aac_parser.c
==============================================================================
--- trunk/libavcodec/aac_parser.c	Wed May 13 10:31:22 2009	(r18813)
+++ trunk/libavcodec/aac_parser.c	Wed May 13 16:11:11 2009	(r18814)
@@ -26,8 +26,6 @@
 #include "get_bits.h"
 #include "mpeg4audio.h"
 
-#define AAC_HEADER_SIZE 7
-
 int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
 {
     int size, rdb, ch, sr;
@@ -56,7 +54,7 @@ int ff_aac_parse_header(GetBitContext *g
     skip_bits1(gbc);             /* copyright_identification_bit */
     skip_bits1(gbc);             /* copyright_identification_start */
     size    = get_bits(gbc, 13); /* aac_frame_length */
-    if(size < AAC_HEADER_SIZE)
+    if(size < AAC_ADTS_HEADER_SIZE)
         return AAC_AC3_PARSE_ERROR_FRAME_SIZE;
 
     skip_bits(gbc, 11);          /* adts_buffer_fullness */
@@ -86,7 +84,7 @@ static int aac_sync(uint64_t state, AACA
     } tmp;
 
     tmp.u64 = be2me_64(state);
-    init_get_bits(&bits, tmp.u8+8-AAC_HEADER_SIZE, AAC_HEADER_SIZE * 8);
+    init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
 
     if ((size = ff_aac_parse_header(&bits, &hdr)) < 0)
         return 0;
@@ -102,7 +100,7 @@ static int aac_sync(uint64_t state, AACA
 static av_cold int aac_parse_init(AVCodecParserContext *s1)
 {
     AACAC3ParseContext *s = s1->priv_data;
-    s->header_size = AAC_HEADER_SIZE;
+    s->header_size = AAC_ADTS_HEADER_SIZE;
     s->sync = aac_sync;
     return 0;
 }

Modified: trunk/libavcodec/aac_parser.h
==============================================================================
--- trunk/libavcodec/aac_parser.h	Wed May 13 10:31:22 2009	(r18813)
+++ trunk/libavcodec/aac_parser.h	Wed May 13 16:11:11 2009	(r18814)
@@ -27,6 +27,8 @@
 #include "aac_ac3_parser.h"
 #include "get_bits.h"
 
+#define AAC_ADTS_HEADER_SIZE 7
+
 typedef struct {
     uint32_t sample_rate;
     uint32_t samples;



More information about the ffmpeg-cvslog mailing list