From: Sebastian Dröge Date: Fri, 8 Apr 2011 12:50:10 +0000 (+0200) Subject: inputselector: Fix getcaps and event function from last commit X-Git-Tag: RELEASE-0.10.33~220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba6054b862403a052f21adc5422c05bd4ce46c38;p=platform%2Fupstream%2Fgstreamer.git inputselector: Fix getcaps and event function from last commit Return ANY caps if the parent disappeared, i.e. the template caps and don't leak events if the parent disappeared. --- diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 3878622..9d13695 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -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);