# HG changeset patch # User alexc # Date 1267706055 0 # Node ID 1682a19a08811d63b1c81f5f79dfddbd16fef9be # Parent 3fa1224ae130ba976bc0294d7dc773241893a35d AAC: Return the number of bytes consumed in decoding a frame. The libfaad wrapper does this. diff -r 3fa1224ae130 -r 1682a19a0881 aac.c --- a/aac.c Thu Mar 04 10:01:03 2010 +0000 +++ b/aac.c Thu Mar 04 12:34:15 2010 +0000 @@ -1948,6 +1948,7 @@ 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 @@ 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)