summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-13 04:07:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-13 04:07:27 +0200
commit952614b8996e33fe406ef91f537e5776cd55111c (patch)
tree848cfd5d9f1368b85b6863317a3b9378f8376836 /libavcodec
parentd7644e0fdb5c6ba58091b62a27ba9eda4fd159f0 (diff)
parentc8cf461c19e8e35df4b7364d9b90aa42f1ab4560 (diff)
Merge commit 'c8cf461c19e8e35df4b7364d9b90aa42f1ab4560'
* commit 'c8cf461c19e8e35df4b7364d9b90aa42f1ab4560': dcadec: Do not decode the XCh extension when downmixing to stereo Conflicts: libavcodec/dcadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dcadec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 5990d545fc..4ad58ee38c 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -2329,6 +2329,17 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
{ /* xxx should also do MA extensions */
if (s->amode < 16) {
avctx->channel_layout = dca_core_channel_layout[s->amode];
+
+ if (s->prim_channels + !!s->lfe > 2 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
+ /*
+ * Neither the core's auxiliary data nor our default tables contain
+ * downmix coefficients for the additional channel coded in the XCh
+ * extension, so when we're doing a Stereo downmix, don't decode it.
+ */
+ s->xch_disable = 1;
+ }
+
#if FF_API_REQUEST_CHANNELS
FF_DISABLE_DEPRECATION_WARNINGS
if (s->xch_present && !s->xch_disable &&