From f10aeab69ca094f2059bad992a8b68bc767a46c9 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 6 May 2012 18:04:09 +0200 Subject: [PATCH] swr: audioconvert: consider mono to be planar This way it will be handled by the planar==planar SIMD Signed-off-by: Michael Niedermayer --- libswresample/audioconvert.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c index 81bd6d30ba..986c45dee6 100644 --- a/libswresample/audioconvert.c +++ b/libswresample/audioconvert.c @@ -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;