From 8fd4e44014119a1c155de64d63d455390f852a22 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 29 Nov 2022 20:32:06 -0800 Subject: audio_core: sink_stream: Hold the suspend lock when process is stalled. - Prevents us from clashing with other callers trying to un/stall. --- src/audio_core/sink/sink_stream.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/audio_core/sink/sink_stream.h') diff --git a/src/audio_core/sink/sink_stream.h b/src/audio_core/sink/sink_stream.h index 38a4b2f51..5fea72ab7 100644 --- a/src/audio_core/sink/sink_stream.h +++ b/src/audio_core/sink/sink_stream.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -240,8 +241,8 @@ private: f32 system_volume{1.0f}; /// Set via IAudioDevice service calls f32 device_volume{1.0f}; - /// True if coretiming has been stalled - bool stalled{false}; + std::mutex stall_guard; + std::unique_lock stalled_lock; }; using SinkStreamPtr = std::unique_ptr; -- cgit v1.2.3