diff options
author | Benjamin Larsson <banan@ludd.ltu.se> | 2008-10-26 10:14:16 +0000 |
---|---|---|
committer | Benjamin Larsson <banan@ludd.ltu.se> | 2008-10-26 10:14:16 +0000 |
commit | ba5fc967f6bd1d9866bcf52880da99dd8f1f5520 (patch) | |
tree | a46e3b61bae4339582719573fddd89521fdafde6 /libavcodec/dca.c | |
parent | 1402ee721aee8e3735a8603c980de1953e9b720c (diff) | |
download | ffmpeg-streaming-ba5fc967f6bd1d9866bcf52880da99dd8f1f5520.zip ffmpeg-streaming-ba5fc967f6bd1d9866bcf52880da99dd8f1f5520.tar.gz |
Disable codec downmix when not using simd instead of silently produce silence
Originally committed as revision 15715 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r-- | libavcodec/dca.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 5565afb..aa89e84 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -1204,11 +1204,6 @@ static av_cold int dca_decode_init(AVCodecContext * avctx) dsputil_init(&s->dsp, avctx); 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++) s->samples_chanptr[i] = s->samples + i * 256; avctx->sample_fmt = SAMPLE_FMT_S16; @@ -1219,6 +1214,12 @@ static av_cold int dca_decode_init(AVCodecContext * avctx) } else { s->add_bias = 0.0f; 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; + } } |