summaryrefslogtreecommitdiffstats
path: root/src/audio_core/sink/sink_stream.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-11-30 05:32:06 +0100
committerbunnei <bunneidev@gmail.com>2022-11-30 05:32:06 +0100
commit8fd4e44014119a1c155de64d63d455390f852a22 (patch)
tree48a00a3e059d61897d2296f7ebcd29e012404954 /src/audio_core/sink/sink_stream.cpp
parentcore: Use atomic instead of a lock to protect is_paused. (diff)
downloadyuzu-8fd4e44014119a1c155de64d63d455390f852a22.tar
yuzu-8fd4e44014119a1c155de64d63d455390f852a22.tar.gz
yuzu-8fd4e44014119a1c155de64d63d455390f852a22.tar.bz2
yuzu-8fd4e44014119a1c155de64d63d455390f852a22.tar.lz
yuzu-8fd4e44014119a1c155de64d63d455390f852a22.tar.xz
yuzu-8fd4e44014119a1c155de64d63d455390f852a22.tar.zst
yuzu-8fd4e44014119a1c155de64d63d455390f852a22.zip
Diffstat (limited to '')
-rw-r--r--src/audio_core/sink/sink_stream.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp
index 849f862b0..67e194e3c 100644
--- a/src/audio_core/sink/sink_stream.cpp
+++ b/src/audio_core/sink/sink_stream.cpp
@@ -266,19 +266,20 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
}
void SinkStream::Stall() {
- if (stalled) {
+ std::scoped_lock lk{stall_guard};
+ if (stalled_lock) {
return;
}
- stalled = true;
- system.StallProcesses();
+ stalled_lock = system.StallProcesses();
}
void SinkStream::Unstall() {
- if (!stalled) {
+ std::scoped_lock lk{stall_guard};
+ if (!stalled_lock) {
return;
}
system.UnstallProcesses();
- stalled = false;
+ stalled_lock.unlock();
}
} // namespace AudioCore::Sink