Revision 676f1f53

View differences:

libavcodec/ac3_parser.c
128 128
    return 0;
129 129
}
130 130

  
131
int ff_ac3_parse_header_full(GetBitContext *gbc, AC3HeaderInfo *hdr){
132
    int ret, i;
133
    ret = ff_ac3_parse_header(gbc, hdr);
134
    if(!ret){
135
        if(hdr->bitstream_id>10){
136
            /* Enhanced AC-3 */
137
            skip_bits(gbc, 5); // skip bitstream id
138

  
139
            /* skip dialog normalization and compression gain */
140
            for (i = 0; i < (hdr->channel_mode ? 1 : 2); i++) {
141
                skip_bits(gbc, 5); // skip dialog normalization
142
                if (get_bits1(gbc)) {
143
                    skip_bits(gbc, 8); //skip Compression gain word
144
                }
145
            }
146
            /* dependent stream channel map */
147
            if (hdr->frame_type == EAC3_FRAME_TYPE_DEPENDENT && get_bits1(gbc)) {
148
                    hdr->channel_map = get_bits(gbc, 16); //custom channel map
149
                    return 0;
150
            }
151
        }
152
        //default channel map based on acmod and lfeon
153
        hdr->channel_map = ff_eac3_default_chmap[hdr->channel_mode];
154
        if(hdr->lfe_on)
155
            hdr->channel_map |= AC3_CHMAP_LFE;
156
    }
157
    return ret;
158
}
159

  
160 131
static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
161 132
        int *need_next_header, int *new_frame_start)
162 133
{
libavcodec/ac3_parser.h
38 38
 */
39 39
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr);
40 40

  
41
/**
42
 * Parse AC-3 frame header and sets channel_map
43
 * Parse the header up to the lfeon (channel_map in E-AC-3)
44
 * element, which is the first 52, 54 or 104 bits depending
45
 * on the audio coding mode.
46
 * @param[in]  gbc BitContext containing the first 54 bits of the frame.
47
 * @param[out] hdr Pointer to struct where header info is written.
48
 * @return value returned by ff_ac3_parse_header
49
 */
50
int ff_ac3_parse_header_full(GetBitContext *gbc, AC3HeaderInfo *hdr);
51

  
52 41
#endif /* AVCODEC_AC3_PARSER_H */

Also available in: Unified diff