summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2012-01-10 13:25:05 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2012-01-18 12:32:37 +0000
commitbaf5a19aeea662bd7f8a5a6df3d110857bd4764b (patch)
tree7eba43cbe780f65b566ad1681fb8c49bd1557725
parentcbe4bb936f7be773938b8539c04973b48e5f4ef5 (diff)
interlace: fix caps leaks
-rw-r--r--gst/interlace/gstinterlace.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c
index 4e224be7b..96455f1a2 100644
--- a/gst/interlace/gstinterlace.c
+++ b/gst/interlace/gstinterlace.c
@@ -187,6 +187,7 @@ static gboolean gst_interlace_setcaps (GstPad * pad, GstCaps * caps);
static GstCaps *gst_interlace_getcaps (GstPad * pad);
static GstStateChangeReturn gst_interlace_change_state (GstElement * element,
GstStateChange transition);
+static void gst_interlace_finalize (GObject * obj);
static GstElementClass *parent_class = NULL;
@@ -242,6 +243,7 @@ gst_interlace_class_init (GstInterlaceClass * klass)
object_class->set_property = gst_interlace_set_property;
object_class->get_property = gst_interlace_get_property;
+ object_class->finalize = gst_interlace_finalize;
element_class->change_state = gst_interlace_change_state;
@@ -269,6 +271,16 @@ gst_interlace_class_init (GstInterlaceClass * klass)
}
static void
+gst_interlace_finalize (GObject * obj)
+{
+ GstInterlace *interlace = GST_INTERLACE (obj);
+
+ gst_caps_replace (&interlace->srccaps, NULL);
+
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
+}
+
+static void
gst_interlace_reset (GstInterlace * interlace)
{
interlace->phase_index = interlace->pattern_offset;
@@ -478,7 +490,7 @@ gst_interlace_setcaps (GstPad * pad, GstCaps * caps)
gboolean interlaced = TRUE;
int fps_n, fps_d;
GstPad *otherpad;
- GstCaps *othercaps;
+ GstCaps *othercaps = NULL;
const PulldownFormat *pdformat;
interlace = GST_INTERLACE (gst_pad_get_parent (pad));
@@ -527,6 +539,8 @@ gst_interlace_setcaps (GstPad * pad, GstCaps * caps)
}
error:
+ if (othercaps)
+ gst_caps_unref (othercaps);
g_object_unref (interlace);
return ret;