input-selector: return FALSE for "active" property if selector is NULL
authorBrendan Long <self@brendanlong.com>
Fri, 31 May 2013 04:57:49 +0000 (22:57 -0600)
committerSebastian Dröge <slomo@circular-chaos.org>
Tue, 4 Jun 2013 15:46:25 +0000 (17:46 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=701323

plugins/elements/gstinputselector.c

index 0d6d0ff..b8bc3b4 100644 (file)
@@ -307,9 +307,13 @@ gst_selector_pad_get_property (GObject * object, guint prop_id,
       GstInputSelector *sel;
 
       sel = GST_INPUT_SELECTOR (gst_pad_get_parent (spad));
-      g_value_set_boolean (value, gst_input_selector_is_active_sinkpad (sel,
-              GST_PAD_CAST (spad)));
-      gst_object_unref (sel);
+      if (sel) {
+        g_value_set_boolean (value, gst_input_selector_is_active_sinkpad (sel,
+                GST_PAD_CAST (spad)));
+        gst_object_unref (sel);
+      } else {
+        g_value_set_boolean (value, FALSE);
+      }
       break;
     }
     case PROP_PAD_ALWAYS_OK: