Commit 57a1403f authored by Max Kellermann's avatar Max Kellermann

output/pipewire: implement Delay(), fix busy loop while paused

parent bad32831
......@@ -179,6 +179,7 @@ private:
pw_thread_loop_signal(thread_loop, false);
}
std::chrono::steady_clock::duration Delay() const noexcept override;
size_t Play(const void *chunk, size_t size) override;
void Drain() override;
......@@ -493,6 +494,19 @@ PipeWireOutput::Process() noexcept
pw_thread_loop_signal(thread_loop, false);
}
std::chrono::steady_clock::duration
PipeWireOutput::Delay() const noexcept
{
const PipeWire::ThreadLoopLock lock(thread_loop);
auto result = std::chrono::steady_clock::duration::zero();
if (paused)
/* idle while paused */
result = std::chrono::seconds(1);
return result;
}
size_t
PipeWireOutput::Play(const void *chunk, size_t size)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment