From 68ea0a2b72e3bd0a15ce978f864b45ee84af9f9e Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 13 Oct 2023 16:34:31 -0400 Subject: [PATCH] audio: fix shutdown deadlock in audio renderer --- src/audio_core/sink/sink_stream.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index 6081352a2..d66d04fae 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp @@ -204,6 +204,10 @@ void SinkStream::ProcessAudioOutAndRender(std::span output_buffer, std::siz // paused and we'll desync, so just play silence. if (system.IsPaused() || system.IsShuttingDown()) { if (system.IsShuttingDown()) { + { + std::scoped_lock lk{release_mutex}; + queued_buffers.store(0); + } release_cv.notify_one(); }