diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-02-12 15:06:58 -0500 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-08 22:07:54 +0100 |
commit | 4a15240a274c1eada288d27c889443ebd6aa62f8 (patch) | |
tree | 762b698072b634279ba4ca44b6ec941529e823ae /libavformat/mov.c | |
parent | a47b96bdd31e00dfa03429ee3b04b84d035bf7f8 (diff) | |
download | ffmpeg-4a15240a274c1eada288d27c889443ebd6aa62f8.tar.gz |
mov: set channel layout for AC-3 streams based on the 'dac3' atom info
fixes Bug 225
(cherry picked from commit 3798205a77ce275613098ecb48645e6029811f14)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index d14ae7ee0d..089cdea558 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -25,11 +25,13 @@ //#define DEBUG //#define MOV_EXPORT_ALL_METADATA +#include "libavutil/audioconvert.h" #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" #include "libavutil/mathematics.h" #include "libavutil/avstring.h" #include "libavutil/dict.h" +#include "libavcodec/ac3tab.h" #include "avformat.h" #include "internal.h" #include "avio_internal.h" @@ -548,6 +550,9 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom) acmod = (ac3info >> 11) & 0x7; lfeon = (ac3info >> 10) & 0x1; st->codec->channels = ((int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon; + st->codec->channel_layout = avpriv_ac3_channel_layout_tab[acmod]; + if (lfeon) + st->codec->channel_layout |= AV_CH_LOW_FREQUENCY; st->codec->audio_service_type = bsmod; if (st->codec->channels > 1 && bsmod == 0x7) st->codec->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE; |