mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
gst: add 30 seconds timeout
Add a timeout to all blocking wait operations so that we don't wait forever but error out after 30 seconds.
This commit is contained in:
parent
d04244abb9
commit
803763ed01
4 changed files with 46 additions and 6 deletions
|
|
@ -160,11 +160,15 @@ GstPipeWireCore *gst_pipewire_core_get (int fd)
|
|||
|
||||
static void do_sync(GstPipeWireCore * core)
|
||||
{
|
||||
struct timespec abstime;
|
||||
core->pending_seq = pw_core_sync(core->core, 0, core->pending_seq);
|
||||
pw_thread_loop_get_time (core->loop, &abstime,
|
||||
GST_PIPEWIRE_DEFAULT_TIMEOUT * SPA_NSEC_PER_SEC);
|
||||
while (true) {
|
||||
if (core->last_seq == core->pending_seq || core->last_error < 0)
|
||||
break;
|
||||
pw_thread_loop_wait (core->loop);
|
||||
if (pw_thread_loop_timed_wait_full (core->loop, &abstime) < 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue