FIX(client): Prevent local muted users from triggering attenuation

Previously, application attenuation and priority speaker attenuation would not
consider local muted clients. In both situations local muted clients
would still lower other clients or applications volume, despite not being
played back.

This commit adds a check to the code where client voice is added
to the mix data structure and prevents local muted clients (including
priority speakers) to be considered in attenuation logic.

Fixes #6247

Co-authored-by: jlallas384 <jlallas384@gmail.com>
This commit is contained in:
Hartmnt 2025-04-13 18:05:35 +00:00
parent 88f25595b6
commit 61b9b0b250

View File

@ -449,14 +449,18 @@ 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) {
// Audio samples
qlMix.append(buffer);
} else if (!user->bLocalMute) {
qlMix.append(buffer);
const ClientUser *user = it.key();
if (user && user->bPrioritySpeaker) {
if (user->bPrioritySpeaker) {
prioritySpeakerActive = true;
}
}