Mercurial > libavcodec.hg
comparison ac3_parser.c @ 6527:32b984487899 libavcodec
Pass AACAC3ParseContext to sync() instead of individual arguments. Patch by
Bartlomiej Wolowiec (bartek wolowiec gmail com)
| author | jbr |
|---|---|
| date | Sun, 23 Mar 2008 15:43:29 +0000 |
| parents | 48759bfbd073 |
| children | 5542d0c04a55 |
comparison
equal
deleted
inserted
replaced
| 6526:737b74bec1e5 | 6527:32b984487899 |
|---|---|
| 117 } | 117 } |
| 118 | 118 |
| 119 return 0; | 119 return 0; |
| 120 } | 120 } |
| 121 | 121 |
| 122 static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate, | 122 static int ac3_sync(AACAC3ParseContext *hdr_info) |
| 123 int *bit_rate, int *samples) | |
| 124 { | 123 { |
| 125 int err; | 124 int err; |
| 126 AC3HeaderInfo hdr; | 125 AC3HeaderInfo hdr; |
| 127 | 126 |
| 128 err = ff_ac3_parse_header(buf, &hdr); | 127 err = ff_ac3_parse_header(hdr_info->inbuf, &hdr); |
| 129 | 128 |
| 130 if(err < 0) | 129 if(err < 0) |
| 131 return 0; | 130 return 0; |
| 132 | 131 |
| 133 *sample_rate = hdr.sample_rate; | 132 hdr_info->sample_rate = hdr.sample_rate; |
| 134 *bit_rate = hdr.bit_rate; | 133 hdr_info->bit_rate = hdr.bit_rate; |
| 135 *channels = hdr.channels; | 134 hdr_info->channels = hdr.channels; |
| 136 *samples = AC3_FRAME_SIZE; | 135 hdr_info->samples = AC3_FRAME_SIZE; |
| 137 return hdr.frame_size; | 136 return hdr.frame_size; |
| 138 } | 137 } |
| 139 | 138 |
| 140 static av_cold int ac3_parse_init(AVCodecParserContext *s1) | 139 static av_cold int ac3_parse_init(AVCodecParserContext *s1) |
| 141 { | 140 { |
