Mercurial > libavcodec.hg
comparison aac.c @ 11362:1682a19a0881 libavcodec
AAC: Return the number of bytes consumed in decoding a frame.
The libfaad wrapper does this.
author | alexc |
---|---|
date | Thu, 04 Mar 2010 12:34:15 +0000 |
parents | a1376a6f9af1 |
children | 4b3da727d832 |
comparison
equal
deleted
inserted
replaced
11361:3fa1224ae130 | 11362:1682a19a0881 |
---|---|
1946 AACContext *ac = avccontext->priv_data; | 1946 AACContext *ac = avccontext->priv_data; |
1947 ChannelElement *che = NULL; | 1947 ChannelElement *che = NULL; |
1948 GetBitContext gb; | 1948 GetBitContext gb; |
1949 enum RawDataBlockType elem_type; | 1949 enum RawDataBlockType elem_type; |
1950 int err, elem_id, data_size_tmp; | 1950 int err, elem_id, data_size_tmp; |
1951 int buf_consumed; | |
1951 | 1952 |
1952 init_get_bits(&gb, buf, buf_size * 8); | 1953 init_get_bits(&gb, buf, buf_size * 8); |
1953 | 1954 |
1954 if (show_bits(&gb, 12) == 0xfff) { | 1955 if (show_bits(&gb, 12) == 0xfff) { |
1955 if (parse_adts_frame_header(ac, &gb) < 0) { | 1956 if (parse_adts_frame_header(ac, &gb) < 0) { |
2046 ac->dsp.float_to_int16_interleave(data, (const float **)ac->output_data, 1024, avccontext->channels); | 2047 ac->dsp.float_to_int16_interleave(data, (const float **)ac->output_data, 1024, avccontext->channels); |
2047 | 2048 |
2048 if (ac->output_configured) | 2049 if (ac->output_configured) |
2049 ac->output_configured = OC_LOCKED; | 2050 ac->output_configured = OC_LOCKED; |
2050 | 2051 |
2051 return buf_size; | 2052 buf_consumed = (get_bits_count(&gb) + 7) >> 3; |
2053 return buf_size > buf_consumed ? buf_consumed : buf_size; | |
2052 } | 2054 } |
2053 | 2055 |
2054 static av_cold int aac_decode_close(AVCodecContext *avccontext) | 2056 static av_cold int aac_decode_close(AVCodecContext *avccontext) |
2055 { | 2057 { |
2056 AACContext *ac = avccontext->priv_data; | 2058 AACContext *ac = avccontext->priv_data; |