From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Fri, 1 Jul 2022 12:32:20 +0000 (+0100) Subject: Stop clipping when mono mixing is selected. X-Git-Tag: 4.1-rc1~24^2~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ab4895f16d02e57aadd81357df29ce94c9ee66a;p=thirdparty%2Fshairport-sync.git Stop clipping when mono mixing is selected. --- diff --git a/player.c b/player.c index f62bc29e..15a8921e 100644 --- a/player.c +++ b/player.c @@ -2201,7 +2201,9 @@ void *player_thread_func(void *arg) { switch (config.playback_mode) { case ST_mono: { - int32_t both = ls + rs; + int32_t lsl = ls; + int32_t rsl = rs; + int32_t both = lsl + rsl; both = both << (16 - 1); // keep all 17 bits of the sum of the 16bit left and right // -- the 17th bit will influence dithering later ll = both;