From 823ee63095af390721453964c6e2bfef25f312ae Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 22 Dec 2019 18:30:43 +0100 Subject: [PATCH] AudioServer: Remove any pending mixer queues whose client disconnected We were pumping the sound device full of silence even after the last audio client disconnected. --- Servers/AudioServer/ASMixer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Servers/AudioServer/ASMixer.cpp b/Servers/AudioServer/ASMixer.cpp index a0316f9d12a..97c4a19e1f6 100644 --- a/Servers/AudioServer/ASMixer.cpp +++ b/Servers/AudioServer/ASMixer.cpp @@ -49,6 +49,8 @@ void ASMixer::mix() continue; } + active_mix_queues.remove_all_matching([&](auto& entry) { return !entry->client(); }); + ASample mixed_buffer[1024]; auto mixed_buffer_length = (int)(sizeof(mixed_buffer) / sizeof(ASample));