swr: audioconvert: consider mono to be planar
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 6 May 2012 16:04:09 +0000 (18:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 May 2012 16:04:09 +0000 (18:04 +0200)
This way it will be handled by the planar==planar SIMD

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

index 81bd6d3..986c45d 100644 (file)
@@ -124,6 +124,12 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt,
     ctx = av_mallocz(sizeof(*ctx));
     if (!ctx)
         return NULL;
+
+    if(channels == 1){
+         in_fmt = av_get_planar_sample_fmt( in_fmt);
+        out_fmt = av_get_planar_sample_fmt(out_fmt);
+    }
+
     ctx->channels = channels;
     ctx->conv_f   = f;
     ctx->ch_map   = ch_map;