summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-28 20:45:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-28 20:45:06 +0200
commit9d7c1b4cf36737bde226d0f7bb4e271e61e4e8a6 (patch)
tree07577504efcb323108e1fcb6d76499a863386589 /libavformat/mov.c
parentc31be45e144a5f4748c9b9d5b8802f254550a471 (diff)
parent9b9df1cdff149db5bbe6726b236934c5b5fbe21d (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: h264: new assembly version of get_cabac for x86_64 with PIC h264: use one table instead of several for cabac functions h264: (trivial) remove unneeded macro argument in x86/cabac.h libschroedingerdec: check malloc segment: reorder seg_write_header allocation avio: make avio_close(NULL) a no-op mov: Parse EC3SpecificBox (dec3 atom). Conflicts: libavcodec/cabac.c libavcodec/x86/cabac.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2f48f2e7ec..5a0353107b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -596,6 +596,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;
@@ -2605,6 +2633,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 },