diff options
author | Bartlomiej Wolowiec <bartek.wolowiec@gmail.com> | 2008-03-24 21:25:49 +0000 |
---|---|---|
committer | Bartlomiej Wolowiec <bartek.wolowiec@gmail.com> | 2008-03-24 21:25:49 +0000 |
commit | 4e6eeaf01968a22748e27590d29f343323cca9c6 (patch) | |
tree | b4c32d09b5b6a3dddf4fd6a917289f7ed7b56b80 /libavcodec/ac3_parser.c | |
parent | b4e806b2b9696443954de88e54ea583d705bcd24 (diff) | |
download | ffmpeg-4e6eeaf01968a22748e27590d29f343323cca9c6.tar.gz |
using stream type in eac3 parser
Originally committed as revision 12570 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3_parser.c')
-rw-r--r-- | libavcodec/ac3_parser.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c index 0a8c804e0a..393133efe7 100644 --- a/libavcodec/ac3_parser.c +++ b/libavcodec/ac3_parser.c @@ -84,10 +84,14 @@ int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr) hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift; hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; + hdr->stream_type = 0; } else { /* Enhanced AC-3 */ hdr->crc1 = 0; - skip_bits(&gbc, 2); // skip stream type + hdr->stream_type = get_bits(&gbc, 2); + if(hdr->stream_type == 3) + return AC3_PARSE_ERROR_STREAM_TYPE; + skip_bits(&gbc, 3); // skip substream id hdr->frame_size = (get_bits(&gbc, 11) + 1) << 1; |