playsink: do not abort if a property is not found.
authorAlban Browaeys <prahal@yahoo.com>
Mon, 14 May 2012 05:01:18 +0000 (07:01 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 15 May 2012 07:22:44 +0000 (09:22 +0200)
If a property is not found (for example last-sample when
gst_debug_bin_to_dot_file is used while the pipeline is
slightly broken (thus no last-sample) the unref of the item
gvalue which is not refed fails. Only unref if it was found.

gst/playback/gstplaysink.c

index bd60120..b772ba3 100644 (file)
@@ -1189,9 +1189,10 @@ gst_play_sink_find_property (GstPlaySink * playsink, GstElement * obj,
     found = gst_iterator_find_custom (it,
         (GCompareFunc) find_property, &item, &helper);
     gst_iterator_free (it);
-    if (found)
+    if (found) {
       result = g_value_dup_object (&item);
-    g_value_unset (&item);
+      g_value_unset (&item);
+    }
   } else {
     if (element_has_property (obj, name, expected_type)) {
       result = obj;