gst: handle stream create error

This commit is contained in:
Wim Taymans 2020-05-21 12:09:45 +02:00
parent c546167ad3
commit 48dea3d5ea

View file

@ -648,7 +648,9 @@ gst_pipewire_sink_start (GstBaseSink * basesink)
}
pw_thread_loop_lock (pwsink->loop);
pwsink->stream = pw_stream_new (pwsink->core, pwsink->client_name, props);
if ((pwsink->stream = pw_stream_new (pwsink->core, pwsink->client_name, props)) == NULL)
goto no_stream;
pwsink->pool->stream = pwsink->stream;
pw_stream_add_listener(pwsink->stream,
@ -659,6 +661,13 @@ gst_pipewire_sink_start (GstBaseSink * basesink)
pw_thread_loop_unlock (pwsink->loop);
return TRUE;
no_stream:
{
GST_ELEMENT_ERROR (pwsink, RESOURCE, FAILED, ("can't create stream"), (NULL));
pw_thread_loop_unlock (pwsink->loop);
return FALSE;
}
}
static gboolean