[0.11] gstreamer: basetransform: Fix a caps leak and move a codeblock
Edward Hervey
bilboed at kemper.freedesktop.org
Tue Oct 11 05:04:29 PDT 2011
Module: gstreamer
Branch: 0.11
Commit: ece59098048c764b5c1662716c2a40dd123df254
URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=ece59098048c764b5c1662716c2a40dd123df254
Author: Edward Hervey <edward.hervey at collabora.co.uk>
Date: Tue Oct 11 13:51:54 2011 +0200
basetransform: Fix a caps leak and move a codeblock
The result from the block of code that was moved would only have
been used if 'peercaps' was present.
---
libs/gst/base/gstbasetransform.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c
index 287b39f..add9cbf 100644
--- a/libs/gst/base/gstbasetransform.c
+++ b/libs/gst/base/gstbasetransform.c
@@ -684,17 +684,17 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
if (caps == NULL)
goto done;
- /* and filter against the template of this pad */
- templ = gst_pad_get_pad_template_caps (pad);
- GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ);
- /* We keep the caps sorted like the returned caps */
- temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST);
- GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
- gst_caps_unref (caps);
- gst_caps_unref (templ);
- caps = temp;
-
if (peercaps) {
+ /* and filter against the template of this pad */
+ templ = gst_pad_get_pad_template_caps (pad);
+ GST_DEBUG_OBJECT (pad, "our template %" GST_PTR_FORMAT, templ);
+ /* We keep the caps sorted like the returned caps */
+ temp = gst_caps_intersect_full (caps, templ, GST_CAPS_INTERSECT_FIRST);
+ GST_DEBUG_OBJECT (pad, "intersected %" GST_PTR_FORMAT, temp);
+ gst_caps_unref (caps);
+ gst_caps_unref (templ);
+ caps = temp;
+
/* Now try if we can put the untransformed downstream caps first */
temp = gst_caps_intersect_full (peercaps, caps, GST_CAPS_INTERSECT_FIRST);
if (!gst_caps_is_empty (temp)) {
@@ -704,6 +704,7 @@ gst_base_transform_getcaps (GstPad * pad, GstCaps * filter)
gst_caps_unref (temp);
}
} else {
+ gst_caps_unref (caps);
/* no peer or the peer can do anything, our padtemplate is enough then */
caps = gst_pad_get_pad_template_caps (pad);
More information about the gstreamer-commits
mailing list