diff options
author | Bartlomiej Wolowiec <bartek.wolowiec@gmail.com> | 2008-04-05 20:09:36 +0000 |
---|---|---|
committer | Bartlomiej Wolowiec <bartek.wolowiec@gmail.com> | 2008-04-05 20:09:36 +0000 |
commit | 0a5754c3b729cf8fc9b938ac0724ee7261aa1606 (patch) | |
tree | 2e7b0cef43ea8ffcd01ae2b1c807336183ba358d /libavcodec/aac_parser.c | |
parent | 0265fe81e4e1c8f8aabb58e1d60a3c0830ea2b5d (diff) | |
download | ffmpeg-0a5754c3b729cf8fc9b938ac0724ee7261aa1606.tar.gz |
change of aac_ac3_parser, so it is able to send complete portion of data to decoder
Originally committed as revision 12758 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aac_parser.c')
-rw-r--r-- | libavcodec/aac_parser.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c index 2e4334f440..ddf82819be 100644 --- a/libavcodec/aac_parser.c +++ b/libavcodec/aac_parser.c @@ -27,12 +27,14 @@ #define AAC_HEADER_SIZE 7 -static int aac_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) +static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, + int *need_next_header, int *new_frame_start) { GetBitContext bits; int size, rdb, ch, sr; + uint64_t tmp = be2me_64(state); - init_get_bits(&bits, hdr_info->inbuf, AAC_HEADER_SIZE * 8); + init_get_bits(&bits, (uint8_t *)&tmp, AAC_HEADER_SIZE * 8); if(get_bits(&bits, 12) != 0xfff) return 0; @@ -65,15 +67,15 @@ static int aac_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) hdr_info->sample_rate = ff_mpeg4audio_sample_rates[sr]; hdr_info->samples = (rdb + 1) * 1024; hdr_info->bit_rate = size * 8 * hdr_info->sample_rate / hdr_info->samples; - *flag = FRAME_COMPLETE; + *need_next_header=0; + *new_frame_start=1; return size; } static av_cold int aac_parse_init(AVCodecParserContext *s1) { AACAC3ParseContext *s = s1->priv_data; - s->inbuf_ptr = s->inbuf; s->header_size = AAC_HEADER_SIZE; s->sync = aac_sync; return 0; |