From 9c2b211f128f39f5cbcf761cc1222e01011f47e2 Mon Sep 17 00:00:00 2001 From: Kelebek1 Date: Sat, 27 May 2023 17:38:07 +0100 Subject: Audren wait as suggested by ByLaws --- src/audio_core/sink/sink_stream.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index 9bbb54162..2331aaff9 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp @@ -273,6 +273,9 @@ void SinkStream::WaitFreeSpace() { std::unique_lock lk{release_mutex}; release_cv.wait_for(lk, std::chrono::milliseconds(5), [this]() { return queued_buffers < max_queue_size; }); + if (queued_buffers > max_queue_size + 3) { + release_cv.wait(lk, [this]() { return queued_buffers < max_queue_size; }); + } } } // namespace AudioCore::Sink -- cgit v1.2.3