From 85f3ef15438fc1fc3c6952da6a4c3d81d2a9fa77 Mon Sep 17 00:00:00 2001 From: Hartmnt Date: Wed, 24 Jan 2024 15:30:00 +0000 Subject: [PATCH] FIX(client): Fix PulseAudio regression by nulling buffer In b5a67c05f a buffer in the PulseAudio backend was made static, but at the same time the memset(0) was removed. In combination, that lead to a bug where the last few frames of any given audio played back was repeated until something else filled the buffer. This commit adds a simple fill to the buffer where the memset(0) previously was fixing the bug. --- src/mumble/PulseAudio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mumble/PulseAudio.cpp b/src/mumble/PulseAudio.cpp index b7ef8872cd6..db2c08a415d 100644 --- a/src/mumble/PulseAudio.cpp +++ b/src/mumble/PulseAudio.cpp @@ -660,6 +660,8 @@ void PulseAudioSystem::write_callback(pa_stream *s, size_t bytes, void *userdata pas->bAttenuating = (Global::get().bAttenuateOthers || Global::get().s.bAttenuateOthers); } else { + std::fill(buffer.begin(), buffer.end(), 0); + // attenuate if intructed to (self-activated) pas->bAttenuating = Global::get().bAttenuateOthers; }