swresample: fix AV_CH_LAYOUT_STEREO_DOWNMIX input
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 23 Apr 2014 23:25:46 +0000 (01:25 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 23 Apr 2014 23:25:46 +0000 (01:25 +0200)
Fixes Ticket 3542

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/rematrix.c

index e146edf..bf2abcf 100644 (file)
@@ -127,6 +127,11 @@ av_cold static int auto_matrix(SwrContext *s)
     )
         out_ch_layout = AV_CH_LAYOUT_STEREO;
 
+    if(    in_ch_layout == AV_CH_LAYOUT_STEREO_DOWNMIX
+       && (out_ch_layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == 0
+    )
+        in_ch_layout = AV_CH_LAYOUT_STEREO;
+
     if(!sane_layout(in_ch_layout)){
         av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout);
         av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);