diff options
author | Tim Walker <tdskywalker@gmail.com> | 2014-04-12 22:11:52 +0200 |
---|---|---|
committer | Tim Walker <tdskywalker@gmail.com> | 2014-05-07 23:50:53 +0200 |
commit | b3d8276d2dc913d708d187fb15f6e98869d00500 (patch) | |
tree | 542320ef3138e7fe1781d8d534653c8c26591042 /libavcodec/dcadec.c | |
parent | 79041d92ee7421853ee8c57fc13891cb0c272e0e (diff) | |
download | ffmpeg-b3d8276d2dc913d708d187fb15f6e98869d00500.tar.gz |
dcadec: Do not decode the XCh extension when downmixing to stereo
This is neither necessary nor currently supported.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit c8cf461c19e8e35df4b7364d9b90aa42f1ab4560)
Diffstat (limited to 'libavcodec/dcadec.c')
-rw-r--r-- | libavcodec/dcadec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 6c240ee5fd..cfce654561 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -1856,6 +1856,16 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data, 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 && |