Commit ba5fc967 authored by Benjamin Larsson's avatar Benjamin Larsson

Disable codec downmix when not using simd instead of silently produce silence

Originally committed as revision 15715 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 1402ee72
...@@ -1204,11 +1204,6 @@ static av_cold int dca_decode_init(AVCodecContext * avctx) ...@@ -1204,11 +1204,6 @@ static av_cold int dca_decode_init(AVCodecContext * avctx)
dsputil_init(&s->dsp, avctx); dsputil_init(&s->dsp, avctx);
ff_mdct_init(&s->imdct, 6, 1); ff_mdct_init(&s->imdct, 6, 1);
/* allow downmixing to stereo */
if (avctx->channels > 0 && avctx->request_channels < avctx->channels &&
avctx->request_channels == 2) {
avctx->channels = avctx->request_channels;
}
for(i = 0; i < 6; i++) for(i = 0; i < 6; i++)
s->samples_chanptr[i] = s->samples + i * 256; s->samples_chanptr[i] = s->samples + i * 256;
avctx->sample_fmt = SAMPLE_FMT_S16; avctx->sample_fmt = SAMPLE_FMT_S16;
...@@ -1219,6 +1214,12 @@ static av_cold int dca_decode_init(AVCodecContext * avctx) ...@@ -1219,6 +1214,12 @@ static av_cold int dca_decode_init(AVCodecContext * avctx)
} else { } else {
s->add_bias = 0.0f; s->add_bias = 0.0f;
s->scale_bias = 1.0; s->scale_bias = 1.0;
/* allow downmixing to stereo */
if (avctx->channels > 0 && avctx->request_channels < avctx->channels &&
avctx->request_channels == 2) {
avctx->channels = avctx->request_channels;
}
} }
......
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