output/Thread: allow Delay() to return duration::max()
Eliminate the periodic wakeups while paused in some output plugins.
This commit is contained in:
@@ -197,7 +197,10 @@ AudioOutputControl::WaitForDelay(std::unique_lock<Mutex> &lock) noexcept
|
||||
if (delay <= std::chrono::steady_clock::duration::zero())
|
||||
return true;
|
||||
|
||||
(void)wake_cond.wait_for(lock, delay);
|
||||
if (delay >= std::chrono::steady_clock::duration::max())
|
||||
wake_cond.wait(lock);
|
||||
else
|
||||
(void)wake_cond.wait_for(lock, delay);
|
||||
|
||||
if (command != Command::NONE)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user