summaryrefslogtreecommitdiff
path: root/libavcodec/aac.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2010-03-04 12:34:15 +0000
committerAlex Converse <alex.converse@gmail.com>2010-03-04 12:34:15 +0000
commitb5e2bb8c3c57de54163311d0c4dcfe38c4f75d04 (patch)
tree29b6e18f6e887e6f860b0bb04084df62dbbc1320 /libavcodec/aac.c
parent660822f0aebf37a8b3a9a89e0fb27096f17a5a42 (diff)
AAC: Return the number of bytes consumed in decoding a frame.
The libfaad wrapper does this. Originally committed as revision 22206 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aac.c')
-rw-r--r--libavcodec/aac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/aac.c b/libavcodec/aac.c
index 160c775f7a..0e014e083d 100644
--- a/libavcodec/aac.c
+++ b/libavcodec/aac.c
@@ -1948,6 +1948,7 @@ static int aac_decode_frame(AVCodecContext *avccontext, void *data,
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(AVCodecContext *avccontext, void *data,
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)