diff options
author | Tim Walker <tdskywalker@gmail.com> | 2013-12-11 02:03:30 +0000 |
---|---|---|
committer | Tim Walker <tdskywalker@gmail.com> | 2014-01-05 16:41:56 +0100 |
commit | 6bfdb2de881372048be7fbda643417e1fd3ce93c (patch) | |
tree | b261bcf51a8930a63254a425738ec2d7adb0c2f0 /libavcodec/dcadec.c | |
parent | 5b4797a21db900b7d509660b7a4d49829089b004 (diff) | |
download | ffmpeg-6bfdb2de881372048be7fbda643417e1fd3ce93c.tar.gz |
dcadec: set the output channel mode more accurately.
When downmixing 2.1 to 2-channel, if the 2.0 portion is Lt/Rt, sum-difference or dual mono, the actual output will be the same (with the LFE either mixed-in or discarded).
Also, when downmixing an arbitrary layout to 2-channel, if the bitstream contains custom downmix coefficients targeting Lt/Rt, then the output will be Lt/Rt rather than regular Stereo.
Diffstat (limited to 'libavcodec/dcadec.c')
-rw-r--r-- | libavcodec/dcadec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index aa713f3481..f3afb4e0f0 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -1890,7 +1890,7 @@ FF_ENABLE_DEPRECATION_WARNINGS if (s->prim_channels + !!s->lfe > 2 && avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) { channels = 2; - s->output = DCA_STEREO; + s->output = s->prim_channels == 2 ? s->amode : DCA_STEREO; avctx->channel_layout = AV_CH_LAYOUT_STEREO; /* Stereo downmix coefficients @@ -1911,6 +1911,7 @@ FF_ENABLE_DEPRECATION_WARNINGS s->downmix_coef[i][1] = (!code ? 0.0f : sign * dca_dmixtable[code - 1]); } + s->output = s->core_downmix_amode; } else { int am = s->amode & DCA_CHANNEL_MASK; if (am >= FF_ARRAY_ELEMS(dca_default_coeffs)) { |