]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Stop clipping when mono mixing is selected.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 1 Jul 2022 12:32:20 +0000 (13:32 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 1 Jul 2022 12:32:20 +0000 (13:32 +0100)
player.c

index f62bc29e483893c022b0ae4453fd8b475efc9223..15a8921e9e6382bcb2b9ff53bc15098c95b079a9 100644 (file)
--- 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;