comparison ac3_parser.c @ 6529:5542d0c04a55 libavcodec

using stream type in eac3 parser
author bwolowiec
date Mon, 24 Mar 2008 21:25:49 +0000
parents 32b984487899
children 5d9fe8d17643
comparison
equal deleted inserted replaced
6528:28d0e7dac45d 6529:5542d0c04a55
82 hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8; 82 hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8;
83 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift; 83 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift;
84 hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift; 84 hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;
85 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; 85 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;
86 hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; 86 hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;
87 hdr->stream_type = 0;
87 } else { 88 } else {
88 /* Enhanced AC-3 */ 89 /* Enhanced AC-3 */
89 hdr->crc1 = 0; 90 hdr->crc1 = 0;
90 skip_bits(&gbc, 2); // skip stream type 91 hdr->stream_type = get_bits(&gbc, 2);
92 if(hdr->stream_type == 3)
93 return AC3_PARSE_ERROR_STREAM_TYPE;
94
91 skip_bits(&gbc, 3); // skip substream id 95 skip_bits(&gbc, 3); // skip substream id
92 96
93 hdr->frame_size = (get_bits(&gbc, 11) + 1) << 1; 97 hdr->frame_size = (get_bits(&gbc, 11) + 1) << 1;
94 if(hdr->frame_size < AC3_HEADER_SIZE) 98 if(hdr->frame_size < AC3_HEADER_SIZE)
95 return AC3_PARSE_ERROR_FRAME_SIZE; 99 return AC3_PARSE_ERROR_FRAME_SIZE;