From bad660fa4366b2353a278d76f7997dc9b343bb3c Mon Sep 17 00:00:00 2001 From: jlallas384 Date: Mon, 15 Apr 2024 00:52:00 +0800 Subject: [PATCH] FIX(client): Prevent local muted users from triggering attenuation When 'while others users talk' attenuation is enabled, unmuted users still trigger attenuation even if they are locally muted. The fix is don't add local muted users' audio source to the mixing for the audio output Fixes #6247 --- src/mumble/AudioOutput.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mumble/AudioOutput.cpp b/src/mumble/AudioOutput.cpp index f67514a6122..ef85c87e7b6 100644 --- a/src/mumble/AudioOutput.cpp +++ b/src/mumble/AudioOutput.cpp @@ -449,14 +449,19 @@ bool AudioOutput::mix(void *outbuff, unsigned int frameCount) { // Get the users that are currently talking (and are thus serving as an audio source) QMultiHash< const ClientUser *, AudioOutputBuffer * >::const_iterator it = qmOutputs.constBegin(); while (it != qmOutputs.constEnd()) { + const ClientUser *user = it.key(); AudioOutputBuffer *buffer = it.value(); + if (!buffer->prepareSampleBuffer(frameCount)) { qlDel.append(buffer); - } else { + } else if (!user) { qlMix.append(buffer); + } else { + if (!user->bLocalMute) { + qlMix.append(buffer); + } - const ClientUser *user = it.key(); - if (user && user->bPrioritySpeaker) { + if (user->bPrioritySpeaker) { prioritySpeakerActive = true; } }