Mercurial > libavcodec.hg
comparison aac_parser.c @ 6643:4d04fcb5e1e4 libavcodec
Add new_frame_start and need_next_header.
based on a patch by Bartlomiej
| author | michael |
|---|---|
| date | Sat, 19 Apr 2008 01:59:55 +0000 |
| parents | 866b9ade048c |
| children | e381bf921a88 |
comparison
equal
deleted
inserted
replaced
| 6642:866b9ade048c | 6643:4d04fcb5e1e4 |
|---|---|
| 25 #include "bitstream.h" | 25 #include "bitstream.h" |
| 26 #include "mpeg4audio.h" | 26 #include "mpeg4audio.h" |
| 27 | 27 |
| 28 #define AAC_HEADER_SIZE 7 | 28 #define AAC_HEADER_SIZE 7 |
| 29 | 29 |
| 30 static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info) | 30 static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, |
| 31 int *need_next_header, int *new_frame_start) | |
| 31 { | 32 { |
| 32 GetBitContext bits; | 33 GetBitContext bits; |
| 33 int size, rdb, ch, sr; | 34 int size, rdb, ch, sr; |
| 34 uint64_t tmp = be2me_64(state); | 35 uint64_t tmp = be2me_64(state); |
| 35 | 36 |
| 65 hdr_info->channels = ff_mpeg4audio_channels[ch]; | 66 hdr_info->channels = ff_mpeg4audio_channels[ch]; |
| 66 hdr_info->sample_rate = ff_mpeg4audio_sample_rates[sr]; | 67 hdr_info->sample_rate = ff_mpeg4audio_sample_rates[sr]; |
| 67 hdr_info->samples = (rdb + 1) * 1024; | 68 hdr_info->samples = (rdb + 1) * 1024; |
| 68 hdr_info->bit_rate = size * 8 * hdr_info->sample_rate / hdr_info->samples; | 69 hdr_info->bit_rate = size * 8 * hdr_info->sample_rate / hdr_info->samples; |
| 69 | 70 |
| 71 *need_next_header = 0; | |
| 72 *new_frame_start = 1; | |
| 70 return size; | 73 return size; |
| 71 } | 74 } |
| 72 | 75 |
| 73 static av_cold int aac_parse_init(AVCodecParserContext *s1) | 76 static av_cold int aac_parse_init(AVCodecParserContext *s1) |
| 74 { | 77 { |
