From 4fb8417b201033ae2de20032b44d52cae1394ff8 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 8 Nov 2023 18:23:02 +0200 Subject: [PATCH 2/2] gstpipewiresrc: break out of wait_started() also on STATE_UNCONNECTED When the session manager sends an error to the client, it typically also destroys the node after the error, which causes the stream to go to STATE_UNCONNECTED via proxy_removed(). In that case, make sure we exit the loop early, otherwise it will take 30 seconds to unblock gst_element_set_state() Upstream-Status: Pipewire MR1763 merged --- src/gst/gstpipewiresrc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index e473338ba..e3b86b373 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -783,10 +783,9 @@ wait_started (GstPipeWireSrc *this) GST_DEBUG_OBJECT (this, "waiting for started signal, state now %s", pw_stream_state_as_string (state)); - if (state == PW_STREAM_STATE_ERROR) - break; - - if (this->flushing) { + if (state == PW_STREAM_STATE_ERROR || + state == PW_STREAM_STATE_UNCONNECTED || + this->flushing) { state = PW_STREAM_STATE_ERROR; break; } -- 2.41.0