From 45bd6ca52bb383a4e0a0a04621c88224d45b86cb Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Tue, 26 May 2020 20:48:08 +0200 Subject: [PATCH] bug fix: server gain calculations were incorrect --- ChangeLog | 7 ++++++- src/server.cpp | 20 ++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8080c7ed..4414cde8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ + 3.5.5git - added vocal banjo/mandolin instrument icons created by atsampson (#283) @@ -13,10 +14,14 @@ - New Client Level now also applies if you enter a server +- bug fix: honour own fader and Mute button in Mute Myself (#148) + - bug fix: audio fader sliders cannot be moved if the main windows is too small (#292) +- bug fix: server gain calculations were incorrect -TODO honour own fader and Mute button in Mute Myself (#148) + +TODO go back to original fader range dynamic (since issue was caused by server gain calculation) diff --git a/src/server.cpp b/src/server.cpp index ff469f4d..11ad954f 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -1203,13 +1203,9 @@ void CServer::ProcessData ( const CVector >& vecvecsData, // mono: copy same mono data in both out stereo audio channels for ( i = 0, k = 0; i < iServerFrameSizeSamples; i++, k += 2 ) { - // left channel - vecsOutData[k] = Double2Short ( - vecsOutData[k] + vecsData[i] * dGain * dGainL ); - - // right channel - vecsOutData[k + 1] = Double2Short ( - vecsOutData[k + 1] + vecsData[i] * dGain * dGainR ); + // left/right channel + vecsOutData[k] = Double2Short ( vecsOutData[k] + vecsData[i] * dGainL ); + vecsOutData[k + 1] = Double2Short ( vecsOutData[k + 1] + vecsData[i] * dGainR ); } } else @@ -1217,13 +1213,9 @@ void CServer::ProcessData ( const CVector >& vecvecsData, // stereo for ( i = 0; i < ( 2 * iServerFrameSizeSamples ); i += 2 ) { - // left channel - vecsOutData[i] = Double2Short ( - vecsOutData[i] + vecsData[i] * dGain * dGainL ); - - // right channel - vecsOutData[i + 1] = Double2Short ( - vecsOutData[i + 1] + vecsData[i + 1] * dGain * dGainR ); + // left/right channel + vecsOutData[i] = Double2Short ( vecsOutData[i] + vecsData[i] * dGainL ); + vecsOutData[i + 1] = Double2Short ( vecsOutData[i + 1] + vecsData[i + 1] * dGainR ); } } }