]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Disable codec downmix when not using simd instead of silently produce silence
authorbanan <banan@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 26 Oct 2008 10:14:16 +0000 (10:14 +0000)
committerbanan <banan@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 26 Oct 2008 10:14:16 +0000 (10:14 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15715 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/dca.c

index 5565afb47d96f534f465437324b99de4a61be113..aa89e848b5b7739e74bab90e4168e77940046022 100644 (file)
@@ -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;
+        }
     }