From edecd7eec38bcc5b8bb41bf5c0cd5e5ec57c402a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 12 Jul 2013 12:05:37 +0200 Subject: [PATCH] playbin: Properly destroy and set to NULL sinks that don't work --- gst/playback/gstplaybin2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index ea066f0fb1..ec4e139cac 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -4233,6 +4233,7 @@ autoplug_select_cb (GstElement * decodebin, GstPad * pad, } else { if (!activate_sink (playbin, *sinkp, NULL)) { gst_object_unref (*sinkp); + *sinkp = NULL; GST_WARNING_OBJECT (playbin, "Could not activate sink %s", gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (ave->sink))); @@ -4381,6 +4382,8 @@ autoplug_select_cb (GstElement * decodebin, GstPad * pad, if (!activate_sink (playbin, element, NULL)) { GST_WARNING_OBJECT (playbin, "Could not activate sink %s", gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory))); + *sinkp = NULL; + gst_object_unref (element); GST_SOURCE_GROUP_UNLOCK (group); return GST_AUTOPLUG_SELECT_SKIP; }