From 89c09f66acc4562ec0be1bf6e51c64209799ab29 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 9 Jan 2023 03:50:02 -0800 Subject: Don't rely on mRateMatch while waiting for PipeWire timing info --- alc/backends/pipewire.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'alc/backends') diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp index f60629de..aa3ae459 100644 --- a/alc/backends/pipewire.cpp +++ b/alc/backends/pipewire.cpp @@ -1609,9 +1609,7 @@ void PipeWirePlayback::start() * is (up to about 2 seconds). */ int wait_count{100}; - pw_stream_state state{PW_STREAM_STATE_STREAMING}; - while(state == PW_STREAM_STATE_STREAMING && mRateMatch) - { + do { pw_time ptime{}; if(int res{pw_stream_get_time_n(mStream.get(), &ptime, sizeof(ptime))}) { @@ -1659,8 +1657,7 @@ void PipeWirePlayback::start() plock.unlock(); std::this_thread::sleep_for(milliseconds{20}); plock.lock(); - state = pw_stream_get_state(mStream.get(), nullptr); - } + } while(pw_stream_get_state(mStream.get(), nullptr) == PW_STREAM_STATE_STREAMING); } void PipeWirePlayback::stop() -- cgit v1.2.3