fix(audio): fix high CPU usage

This commit is contained in:
wiiznokes 2024-09-09 21:37:25 +02:00 committed by GitHub
parent b449d0668b
commit fe598a7a60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -219,6 +219,10 @@ impl PulseHandle {
loop {
// This is where the we match messages from the GUI to pass to the pulse server
let mut msgs = Vec::new();
if let Some(msg) = to_pulse_recv.recv().await {
msgs.push(msg);
}
while let Ok(msg) = to_pulse_recv.try_recv() {
msgs.push(msg);
}