From: Wim Taymans Date: Mon, 16 May 2011 16:29:29 +0000 (+0200) Subject: capsfilter: allow NULL filters and fix refcounting X-Git-Tag: RELEASE-0.11.0~304 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf4c9556158a88c8856f46026529627cb1d483c0;p=platform%2Fupstream%2Fgstreamer.git capsfilter: allow NULL filters and fix refcounting --- diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c index 192939e..b70b93b 100644 --- a/plugins/elements/gstcapsfilter.c +++ b/plugins/elements/gstcapsfilter.c @@ -258,8 +258,14 @@ gst_capsfilter_transform_caps (GstBaseTransform * base, filter_caps = gst_caps_ref (capsfilter->filter_caps); GST_OBJECT_UNLOCK (capsfilter); - tmp = gst_caps_intersect_full (filter, filter_caps, GST_CAPS_INTERSECT_FIRST); - ret = gst_caps_intersect_full (tmp, caps, GST_CAPS_INTERSECT_FIRST); + if (filter) { + tmp = + gst_caps_intersect_full (filter, filter_caps, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (filter_caps); + filter_caps = tmp; + } + + ret = gst_caps_intersect_full (filter_caps, caps, GST_CAPS_INTERSECT_FIRST); GST_DEBUG_OBJECT (capsfilter, "input: %" GST_PTR_FORMAT, caps); GST_DEBUG_OBJECT (capsfilter, "filter: %" GST_PTR_FORMAT, filter);