mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-04 14:02:45 +01:00
Audren wait as suggested by ByLaws
This commit is contained in:
parent
d6db422098
commit
9c2b211f12
1 changed files with 3 additions and 0 deletions
|
@ -273,6 +273,9 @@ void SinkStream::WaitFreeSpace() {
|
||||||
std::unique_lock lk{release_mutex};
|
std::unique_lock lk{release_mutex};
|
||||||
release_cv.wait_for(lk, std::chrono::milliseconds(5),
|
release_cv.wait_for(lk, std::chrono::milliseconds(5),
|
||||||
[this]() { return queued_buffers < max_queue_size; });
|
[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
|
} // namespace AudioCore::Sink
|
||||||
|
|
Loading…
Reference in a new issue