From 659e1f0a3f6a29aea2a220203643f6b44eaf65e9 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 29 Jul 2021 17:49:52 -0400 Subject: [PATCH] audiocvt: The to-5.1 converters now soften FL and FR channels more. This is experimental and might be tweaked further. Reference #4104. Also reference: https://github.com/Keriew/augustus/issues/194#issuecomment-847655049 --- src/audio/SDL_audiocvt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 34f505f6d..19a08354b 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -397,8 +397,8 @@ SDL_ConvertStereoTo51(SDL_AudioCVT * cvt, SDL_AudioFormat format) lf = src[0]; rf = src[1]; ce = (lf + rf) * 0.5f; - dst[0] = 0.5f * (lf + (lf - ce)); /* FL */ - dst[1] = 0.5f * (rf + (rf - ce)); /* FR */ + dst[0] = 0.571f * (lf + (lf - 0.5f * ce)); /* FL */ + dst[1] = 0.571f * (rf + (rf - 0.5f * ce)); /* FR */ dst[2] = ce; /* FC */ dst[3] = 0; /* LFE (only meant for special LFE effects) */ dst[4] = lf; /* BL */ @@ -433,8 +433,8 @@ SDL_ConvertQuadTo51(SDL_AudioCVT * cvt, SDL_AudioFormat format) lb = src[2]; rb = src[3]; ce = (lf + rf) * 0.5f; - dst[0] = 0.5f * (lf + (lf - ce)); /* FL */ - dst[1] = 0.5f * (rf + (rf - ce)); /* FR */ + dst[0] = 0.571f * (lf + (lf - 0.5f * ce)); /* FL */ + dst[1] = 0.571f * (rf + (rf - 0.5f * ce)); /* FR */ dst[2] = ce; /* FC */ dst[3] = 0; /* LFE (only meant for special LFE effects) */ dst[4] = lb; /* BL */