Commit 95283c17 authored by Justin Ruggles's avatar Justin Ruggles

check for request_channels at codec init

Originally committed as revision 11415 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 6cd325c1
......@@ -312,6 +312,13 @@ static int ac3_decode_init(AVCodecContext *avctx)
s->mul_bias = 32767.0f;
}
/* allow downmixing to stereo or mono */
if (avctx->channels > 0 && avctx->request_channels > 0 &&
avctx->request_channels < avctx->channels &&
avctx->request_channels <= 2) {
avctx->channels = avctx->request_channels;
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment