Mercurial > libavcodec.hg
comparison aac.c @ 8812:541889e539b8 libavcodec
Add support for sample rate index 12, 7350 Hz
Patch by Alex Converse ( alex converse gmail com )
author | superdump |
---|---|
date | Thu, 12 Feb 2009 13:31:43 +0000 |
parents | 464c36527303 |
children | 13db7a524778 |
comparison
equal
deleted
inserted
replaced
8811:464c36527303 | 8812:541889e539b8 |
---|---|
171 int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index; | 171 int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index; |
172 | 172 |
173 skip_bits(gb, 2); // object_type | 173 skip_bits(gb, 2); // object_type |
174 | 174 |
175 sampling_index = get_bits(gb, 4); | 175 sampling_index = get_bits(gb, 4); |
176 if(sampling_index > 11) { | 176 if(sampling_index > 12) { |
177 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); | 177 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); |
178 return -1; | 178 return -1; |
179 } | 179 } |
180 ac->m4ac.sampling_index = sampling_index; | 180 ac->m4ac.sampling_index = sampling_index; |
181 ac->m4ac.sample_rate = ff_mpeg4audio_sample_rates[ac->m4ac.sampling_index]; | 181 ac->m4ac.sample_rate = ff_mpeg4audio_sample_rates[ac->m4ac.sampling_index]; |
324 | 324 |
325 init_get_bits(&gb, data, data_size * 8); | 325 init_get_bits(&gb, data, data_size * 8); |
326 | 326 |
327 if((i = ff_mpeg4audio_get_config(&ac->m4ac, data, data_size)) < 0) | 327 if((i = ff_mpeg4audio_get_config(&ac->m4ac, data, data_size)) < 0) |
328 return -1; | 328 return -1; |
329 if(ac->m4ac.sampling_index > 11) { | 329 if(ac->m4ac.sampling_index > 12) { |
330 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); | 330 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); |
331 return -1; | 331 return -1; |
332 } | 332 } |
333 | 333 |
334 skip_bits_long(&gb, i); | 334 skip_bits_long(&gb, i); |
1553 if (show_bits(&gb, 12) == 0xfff) { | 1553 if (show_bits(&gb, 12) == 0xfff) { |
1554 if ((err = parse_adts_frame_header(ac, &gb)) < 0) { | 1554 if ((err = parse_adts_frame_header(ac, &gb)) < 0) { |
1555 av_log(avccontext, AV_LOG_ERROR, "Error decoding AAC frame header.\n"); | 1555 av_log(avccontext, AV_LOG_ERROR, "Error decoding AAC frame header.\n"); |
1556 return -1; | 1556 return -1; |
1557 } | 1557 } |
1558 if (ac->m4ac.sampling_index > 11) { | 1558 if (ac->m4ac.sampling_index > 12) { |
1559 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); | 1559 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); |
1560 return -1; | 1560 return -1; |
1561 } | 1561 } |
1562 } | 1562 } |
1563 | 1563 |