Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Make LiveKit source use audio priority (#44881)

Yara 🏳️‍⚧️a6b7af3cbdff
diff --git a/crates/livekit_client/src/livekit_client/playback/source.rs b/crates/livekit_client/src/livekit_client/playback/source.rs
index cde4b19fda2..a258c585285 100644
--- a/crates/livekit_client/src/livekit_client/playback/source.rs
+++ b/crates/livekit_client/src/livekit_client/playback/source.rs
@@ -47,14 +47,17 @@ impl LiveKitStream {
);
let (queue_input, queue_output) = rodio::queue::queue(true);
// spawn rtc stream
- let receiver_task = executor.spawn({
- async move {
- while let Some(frame) = stream.next().await {
- let samples = frame_to_samplesbuffer(frame);
- queue_input.append(samples);
+ let receiver_task = executor.spawn_with_priority(
+ gpui::Priority::Realtime(gpui::RealtimePriority::Audio),
+ {
+ async move {
+ while let Some(frame) = stream.next().await {
+ let samples = frame_to_samplesbuffer(frame);
+ queue_input.append(samples);
+ }
}
- }
- });
+ },
+ );
LiveKitStream {
_receiver_task: receiver_task,