Mercurial > libavcodec.hg
comparison ac3_parser.c @ 7012:4156c54aedba libavcodec
get substreamid from ac3 parser
| author | jbr |
|---|---|
| date | Sat, 07 Jun 2008 22:29:11 +0000 |
| parents | 77f607fb4e8b |
| children | b514562e0aef |
comparison
equal
deleted
inserted
replaced
| 7011:77f607fb4e8b | 7012:4156c54aedba |
|---|---|
| 97 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift; | 97 hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift; |
| 98 hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift; | 98 hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift; |
| 99 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; | 99 hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on; |
| 100 hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; | 100 hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2; |
| 101 hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //EAC3_FRAME_TYPE_INDEPENDENT; | 101 hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT; //EAC3_FRAME_TYPE_INDEPENDENT; |
| 102 hdr->substreamid = 0; | |
| 102 } else { | 103 } else { |
| 103 /* Enhanced AC-3 */ | 104 /* Enhanced AC-3 */ |
| 104 hdr->crc1 = 0; | 105 hdr->crc1 = 0; |
| 105 hdr->frame_type = get_bits(gbc, 2); | 106 hdr->frame_type = get_bits(gbc, 2); |
| 106 if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED) | 107 if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED) |
| 107 return AC3_PARSE_ERROR_FRAME_TYPE; | 108 return AC3_PARSE_ERROR_FRAME_TYPE; |
| 108 | 109 |
| 109 skip_bits(gbc, 3); // skip substream id | 110 hdr->substreamid = get_bits(gbc, 3); |
| 110 | 111 |
| 111 hdr->frame_size = (get_bits(gbc, 11) + 1) << 1; | 112 hdr->frame_size = (get_bits(gbc, 11) + 1) << 1; |
| 112 if(hdr->frame_size < AC3_HEADER_SIZE) | 113 if(hdr->frame_size < AC3_HEADER_SIZE) |
| 113 return AC3_PARSE_ERROR_FRAME_SIZE; | 114 return AC3_PARSE_ERROR_FRAME_SIZE; |
| 114 | 115 |
