From 2dd2e429517d98b3bc97a432a699835ccc62e720 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 6 Sep 2012 22:32:39 +0200 Subject: [PATCH] swr: update rematrix coeffs to match AC-3 Signed-off-by: Michael Niedermayer --- libswresample/rematrix.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index 26e76a2ed8..7652fd8a32 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -150,8 +150,13 @@ static int auto_matrix(SwrContext *s) if(unaccounted & AV_CH_FRONT_CENTER){ if((s->out_ch_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO){ - matrix[ FRONT_LEFT][FRONT_CENTER]+= M_SQRT1_2; - matrix[FRONT_RIGHT][FRONT_CENTER]+= M_SQRT1_2; + if(s->in_ch_layout & AV_CH_LAYOUT_STEREO) { + matrix[ FRONT_LEFT][FRONT_CENTER]+= s->clev; + matrix[FRONT_RIGHT][FRONT_CENTER]+= s->clev; + } else { + matrix[ FRONT_LEFT][FRONT_CENTER]+= M_SQRT1_2; + matrix[FRONT_RIGHT][FRONT_CENTER]+= M_SQRT1_2; + } }else av_assert0(0); }