Commit fd4a667a authored by andoma's avatar andoma

Make DCA decoder honor avctx->request_channels in a more advisory way.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11221 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e83ab910
......@@ -1159,23 +1159,12 @@ static int dca_decode_frame(AVCodecContext * avctx,
avctx->bit_rate = s->bit_rate;
channels = s->prim_channels + !!s->lfe;
avctx->channels = avctx->request_channels;
if(avctx->channels == 0) {
avctx->channels = channels;
} else if(channels < avctx->channels) {
av_log(avctx, AV_LOG_WARNING, "DTS source channels are less than "
"specified: output to %d channels.\n", channels);
avctx->channels = channels;
}
if(avctx->channels == 2) {
if(avctx->request_channels == 2 && s->prim_channels > 2) {
channels = 2;
s->output = DCA_STEREO;
} else if(avctx->channels != channels) {
av_log(avctx, AV_LOG_ERROR, "Cannot downmix DTS to %d channels.\n",
avctx->channels);
return -1;
}
channels = avctx->channels;
avctx->channels = channels;
if(*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * channels)
return -1;
*data_size = 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