From cfec09e91423018bbefe29e31254e03e0d286ce5 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 5 Jan 2008 21:23:57 +0000 Subject: [PATCH] check for request_channels in dca init function Originally committed as revision 11423 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/dca.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 0bfc294d71..9d373e225b 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -1230,6 +1230,13 @@ static int dca_decode_init(AVCodecContext * avctx) pre_calc_cosmod(s); dsputil_init(&s->dsp, avctx); + + /* allow downmixing to stereo */ + if (avctx->channels > 0 && avctx->request_channels < avctx->channels && + avctx->request_channels == 2) { + avctx->channels = avctx->request_channels; + } + return 0; }