comparison aac.c @ 9716:d45e44454d13 libavcodec

In the event of a mismatch, do not follow the sample rate index in an AAC PCE. This matches the behavior the reference decoder and fixes issue 1072.
author alexc
date Tue, 26 May 2009 21:34:56 +0000
parents 67a20f0eb42c
children 4cac4001dd23
comparison
equal deleted inserted replaced
9715:997d2de9cd84 9716:d45e44454d13
229 int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index; 229 int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index;
230 230
231 skip_bits(gb, 2); // object_type 231 skip_bits(gb, 2); // object_type
232 232
233 sampling_index = get_bits(gb, 4); 233 sampling_index = get_bits(gb, 4);
234 if(sampling_index > 12) { 234 if (ac->m4ac.sampling_index != sampling_index)
235 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); 235 av_log(ac->avccontext, AV_LOG_WARNING, "Sample rate index in program config element does not match the sample rate index configured by the container.\n");
236 return -1; 236
237 }
238 ac->m4ac.sampling_index = sampling_index;
239 ac->m4ac.sample_rate = ff_mpeg4audio_sample_rates[ac->m4ac.sampling_index];
240 num_front = get_bits(gb, 4); 237 num_front = get_bits(gb, 4);
241 num_side = get_bits(gb, 4); 238 num_side = get_bits(gb, 4);
242 num_back = get_bits(gb, 4); 239 num_back = get_bits(gb, 4);
243 num_lfe = get_bits(gb, 2); 240 num_lfe = get_bits(gb, 2);
244 num_assoc_data = get_bits(gb, 3); 241 num_assoc_data = get_bits(gb, 3);