mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
gst: handle some more errors
The threadloop might fail to create because of missing plugins, so handle that. The context might fail to create because of some fatal config error or missing plugin, handle that too instead of crashing. See #3994
This commit is contained in:
parent
f524271b81
commit
2d379bf908
1 changed files with 17 additions and 0 deletions
|
|
@ -51,7 +51,11 @@ static GstPipeWireCore *make_core (int fd)
|
|||
core->refcount = 1;
|
||||
core->fd = fd;
|
||||
core->loop = pw_thread_loop_new ("pipewire-main-loop", NULL);
|
||||
if (core->loop == NULL)
|
||||
goto loop_failed;
|
||||
core->context = pw_context_new (pw_thread_loop_get_loop(core->loop), NULL, 0);
|
||||
if (core->context == NULL)
|
||||
goto context_failed;
|
||||
core->last_seq = -1;
|
||||
core->last_error = 0;
|
||||
GST_DEBUG ("loop %p context %p", core->loop, core->context);
|
||||
|
|
@ -78,6 +82,19 @@ static GstPipeWireCore *make_core (int fd)
|
|||
|
||||
return core;
|
||||
|
||||
loop_failed:
|
||||
{
|
||||
GST_ERROR ("error creating threadloop");
|
||||
g_free (core);
|
||||
return NULL;
|
||||
}
|
||||
context_failed:
|
||||
{
|
||||
GST_ERROR ("error creating context");
|
||||
pw_thread_loop_destroy (core->loop);
|
||||
g_free (core);
|
||||
return NULL;
|
||||
}
|
||||
mainloop_failed:
|
||||
{
|
||||
GST_ERROR ("error starting mainloop");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue