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;