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
This commit is contained in:
Wim Taymans 2024-03-01 10:29:18 +01:00
parent 06f63f489a
commit 0f14cc3b13

View file

@ -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;