Skip to content

Commit

Permalink
Merge pull request tvheadend#56 from lunds/aac_sbr_fix
Browse files Browse the repository at this point in the history
Multiplex HE-AAC with explicit SBR signalling in MKV
  • Loading branch information
andoma committed Feb 22, 2012
2 parents 4bb1566 + 3e3a197 commit b877800
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/parser_latm.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,28 @@ read_audio_specific_config(elementary_stream_t *st, latm_private_t *latm,
int aot, sr;

aot = read_bits(bs, 5);
if(aot != 2)
return;

latm->sample_rate_index = read_bits(bs, 4);

if(latm->sample_rate_index == 0xf)
return;
sr = read_bits(bs, 24);
else
sr = sri_to_rate(latm->sample_rate_index);

sr = sri_to_rate(latm->sample_rate_index);
st->es_frame_duration = 1024 * 90000 / sr;

latm->channel_config = read_bits(bs, 4);

if (aot == 5) { // AOT_SBR
if (read_bits(bs, 4) == 0xf) { // extensionSamplingFrequencyIndex
skip_bits(bs, 24);
}
aot = read_bits(bs, 5); // this is the main object type (i.e. non-extended)
}

if(aot != 2)
return;

skip_bits(bs, 1); //framelen_flag
if(read_bits1(bs)) // depends_on_coder
skip_bits(bs, 14);
Expand Down

0 comments on commit b877800

Please sign in to comment.