[FFmpeg-cvslog] r22206 - trunk/libavcodec/aac.c

alexc subversion
Thu Mar 4 13:34:15 CET 2010


Author: alexc
Date: Thu Mar  4 13:34:15 2010
New Revision: 22206

Log:
AAC: Return the number of bytes consumed in decoding a frame.

The libfaad wrapper does this.

Modified:
   trunk/libavcodec/aac.c

Modified: trunk/libavcodec/aac.c
==============================================================================
--- trunk/libavcodec/aac.c	Thu Mar  4 12:27:39 2010	(r22205)
+++ trunk/libavcodec/aac.c	Thu Mar  4 13:34:15 2010	(r22206)
@@ -1948,6 +1948,7 @@ static int aac_decode_frame(AVCodecConte
     GetBitContext gb;
     enum RawDataBlockType elem_type;
     int err, elem_id, data_size_tmp;
+    int buf_consumed;
 
     init_get_bits(&gb, buf, buf_size * 8);
 
@@ -2048,7 +2049,8 @@ static int aac_decode_frame(AVCodecConte
     if (ac->output_configured)
         ac->output_configured = OC_LOCKED;
 
-    return buf_size;
+    buf_consumed = (get_bits_count(&gb) + 7) >> 3;
+    return buf_size > buf_consumed ? buf_consumed : buf_size;
 }
 
 static av_cold int aac_decode_close(AVCodecContext *avccontext)



More information about the ffmpeg-cvslog mailing list