diff options
Diffstat (limited to 'gst/autodetect/gstautovideosink.c')
-rw-r--r-- | gst/autodetect/gstautovideosink.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gst/autodetect/gstautovideosink.c b/gst/autodetect/gstautovideosink.c index 6d5a9312..085dea1b 100644 --- a/gst/autodetect/gstautovideosink.c +++ b/gst/autodetect/gstautovideosink.c @@ -212,11 +212,8 @@ gst_auto_video_sink_detect (GstAutoVideoSink * sink) /* find element */ GST_DEBUG_OBJECT (sink, "Creating new kid"); - if (!(esink = gst_auto_video_sink_find_best (sink))) { - GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL), - ("Failed to find a supported video sink")); - return FALSE; - } + if (!(esink = gst_auto_video_sink_find_best (sink))) + goto no_sink; sink->kid = esink; gst_bin_add (GST_BIN (sink), esink); @@ -229,6 +226,14 @@ gst_auto_video_sink_detect (GstAutoVideoSink * sink) GST_DEBUG_OBJECT (sink, "done changing auto video sink"); return TRUE; + + /* ERRORS */ +no_sink: + { + GST_ELEMENT_ERROR (sink, LIBRARY, INIT, (NULL), + ("Failed to find a supported video sink")); + return FALSE; + } } static GstStateChangeReturn |