diff options
author | Yusuke Nakamura <muken.the.vfrmaniac@gmail.com> | 2011-05-31 08:17:13 +0900 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-04-27 16:11:46 -0400 |
commit | 546adc1fee1f6975af2cebb91307b8415dfa9172 (patch) | |
tree | 365503b3e0f14570d657847e33ca93a9aa25afc9 /libavformat | |
parent | df8aa4598c7cc1c2f863f6fc6b2d4b3e6dc7345e (diff) | |
download | ffmpeg-546adc1fee1f6975af2cebb91307b8415dfa9172.tar.gz |
mov: Parse EC3SpecificBox (dec3 atom).
Skip to parse fields for additional independent substreams and its
associated dependent substreams since libavcodec's E-AC-3 decoder does not
support them yet.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 747f062833..04deef6a16 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -565,6 +565,34 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } +static int mov_read_dec3(MOVContext *c, AVIOContext *pb, MOVAtom atom) +{ + AVStream *st; + int eac3info, acmod, lfeon, bsmod; + + if (c->fc->nb_streams < 1) + return 0; + st = c->fc->streams[c->fc->nb_streams-1]; + + /* No need to parse fields for additional independent substreams and its + * associated dependent substreams since libavcodec's E-AC-3 decoder + * does not support them yet. */ + avio_rb16(pb); /* data_rate and num_ind_sub */ + eac3info = avio_rb24(pb); + bsmod = (eac3info >> 12) & 0x1f; + acmod = (eac3info >> 9) & 0x7; + lfeon = (eac3info >> 8) & 0x1; + st->codec->channel_layout = avpriv_ac3_channel_layout_tab[acmod]; + if (lfeon) + st->codec->channel_layout |= AV_CH_LOW_FREQUENCY; + st->codec->channels = av_get_channel_layout_nb_channels(st->codec->channel_layout); + st->codec->audio_service_type = bsmod; + if (st->codec->channels > 1 && bsmod == 0x7) + st->codec->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE; + + return 0; +} + static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; @@ -2472,6 +2500,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = { { MKTAG('w','a','v','e'), mov_read_wave }, { MKTAG('e','s','d','s'), mov_read_esds }, { MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */ +{ MKTAG('d','e','c','3'), mov_read_dec3 }, /* EAC-3 info */ { MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */ { MKTAG('w','f','e','x'), mov_read_wfex }, { MKTAG('c','m','o','v'), mov_read_cmov }, |