inputselector: Fix getcaps and event function from last commit
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 8 Apr 2011 12:50:10 +0000 (14:50 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 8 Apr 2011 12:50:10 +0000 (14:50 +0200)
Return ANY caps if the parent disappeared, i.e. the template caps
and don't leak events if the parent disappeared.

plugins/elements/gstinputselector.c

index 3878622..9d13695 100644 (file)
@@ -1174,8 +1174,10 @@ gst_input_selector_event (GstPad * pad, GstEvent * event)
   GstPad *otherpad;
 
   sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
-  if (G_UNLIKELY (sel == NULL))
+  if (G_UNLIKELY (sel == NULL)) {
+    gst_event_unref (event);
     return FALSE;
+  }
 
   otherpad = gst_input_selector_get_linked_pad (sel, pad, TRUE);
   if (otherpad) {
@@ -1283,7 +1285,7 @@ gst_input_selector_getcaps (GstPad * pad)
 
   sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
   if (G_UNLIKELY (sel == NULL))
-    return FALSE;
+    return gst_caps_new_any ();
 
   otherpad = gst_input_selector_get_linked_pad (sel, pad, FALSE);