From 48dea3d5ea2995755ae27f6fb1e0e08ea5fc9423 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 21 May 2020 12:09:45 +0200 Subject: [PATCH] gst: handle stream create error --- src/gst/gstpipewiresink.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c index be383ee56..c15c6c1a4 100644 --- a/src/gst/gstpipewiresink.c +++ b/src/gst/gstpipewiresink.c @@ -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