From 4fba8666763baed633999063cde7fd1de5e9b555 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 1 Mar 2024 10:29:18 +0100 Subject: [PATCH] gst: remove timeouts when autoconnect=false When we disable autoconnect, disable the timeouts as well. Otherwise the user has to connect the stream within the 30 second timeout or get a failure. With autoconnect we can reasonably assume there is a problem when the stream is not connected after 30 seconds. Fixes #3884 --- src/gst/gstpipewiresrc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index d95e99620..0a8ffd761 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -793,9 +793,13 @@ wait_started (GstPipeWireSrc *this) if (this->started) break; - if (pw_thread_loop_timed_wait_full (this->core->loop, &abstime) < 0) { - state = PW_STREAM_STATE_ERROR; - break; + if (this->autoconnect) { + if (pw_thread_loop_timed_wait_full (this->core->loop, &abstime) < 0) { + state = PW_STREAM_STATE_ERROR; + break; + } + } else { + pw_thread_loop_wait (this->core->loop); } prev_state = state; @@ -923,8 +927,12 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc) if (pwsrc->negotiated) break; - if (pw_thread_loop_timed_wait_full (pwsrc->core->loop, &abstime) < 0) + if (pwsrc->autoconnect) { + if (pw_thread_loop_timed_wait_full (pwsrc->core->loop, &abstime) < 0) goto connect_error; + } else { + pw_thread_loop_wait (pwsrc->core->loop); + } } caps = pwsrc->caps; pwsrc->caps = NULL;