summaryrefslogtreecommitdiff
path: root/Servers/AudioServer
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-22 18:30:43 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-22 18:30:43 +0100
commit823ee63095af390721453964c6e2bfef25f312ae (patch)
tree46d3561e6149abc4a029e6ab8847ccb98da22ef9 /Servers/AudioServer
parent11d49aedd87bcc522c0de0bbe3b5a44a7b3e3151 (diff)
downloadserenity-823ee63095af390721453964c6e2bfef25f312ae.zip
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.
Diffstat (limited to 'Servers/AudioServer')
-rw-r--r--Servers/AudioServer/ASMixer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Servers/AudioServer/ASMixer.cpp b/Servers/AudioServer/ASMixer.cpp
index a0316f9d12..97c4a19e1f 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));