aac: Set sample rate in avctx from ADTS header (if not already set by some

other means)

Originally committed as revision 20773 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Andreas Öman 2009-12-08 19:20:36 +00:00
parent e262365d7c
commit f658631419
1 changed files with 2 additions and 0 deletions

View File

@ -1692,6 +1692,8 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
ac->m4ac.sample_rate = hdr_info.sample_rate; ac->m4ac.sample_rate = hdr_info.sample_rate;
ac->m4ac.sampling_index = hdr_info.sampling_index; ac->m4ac.sampling_index = hdr_info.sampling_index;
ac->m4ac.object_type = hdr_info.object_type; ac->m4ac.object_type = hdr_info.object_type;
if (!ac->avccontext->sample_rate)
ac->avccontext->sample_rate = hdr_info.sample_rate;
if (hdr_info.num_aac_frames == 1) { if (hdr_info.num_aac_frames == 1) {
if (!hdr_info.crc_absent) if (!hdr_info.crc_absent)
skip_bits(gb, 16); skip_bits(gb, 16);