From 45febdebe1338596fa846ca92c672cd3d68f8542 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 14 Jun 2010 19:40:50 +0200 Subject: [PATCH] GESTrackTransition: Release all pads. Whether calling get_request_pad or get_static_pad we always end up with an extra reference. Also keep a reference on videomixer so it doesn't go away before we call _release_request_pad() on it with the proper pads to release. --- ges/ges-track-transition.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ges/ges-track-transition.c b/ges/ges-track-transition.c index 3e87b820fa..0a11559e8e 100644 --- a/ges/ges-track-transition.c +++ b/ges/ges-track-transition.c @@ -184,10 +184,13 @@ ges_track_transition_dispose (GObject * object) self->a_bcontrol_source = NULL; } - if (self->sinka) { + if (self->vmixer && self->sinka && self->sinkb) { GST_DEBUG ("releasing request pads for vmixer"); gst_element_release_request_pad (self->vmixer, self->sinka); gst_element_release_request_pad (self->vmixer, self->sinkb); + gst_object_unref (self->vmixer); + gst_object_unref (self->sinka); + gst_object_unref (self->sinkb); self->vmixer = NULL; self->sinka = NULL; self->sinkb = NULL; @@ -212,6 +215,7 @@ link_element_to_mixer (GstElement * element, GstElement * mixer) g_assert (srcpad); gst_pad_link (srcpad, sinkpad); + gst_object_unref (srcpad); return G_OBJECT (sinkpad); } @@ -282,7 +286,7 @@ create_video_bin (GESTrackTransition * self) self->sinka = (GstPad *) link_element_to_mixer (iconva, mixer); self->sinkb = (GstPad *) link_element_to_mixer (iconvb, mixer); target = (GObject *) self->sinkb; - self->vmixer = mixer; + self->vmixer = gst_object_ref (mixer); propname = "alpha"; self->vstart_value = 0.0; self->vend_value = 1.0; @@ -302,6 +306,10 @@ create_video_bin (GESTrackTransition * self) gst_element_add_pad (topbin, sinka); gst_element_add_pad (topbin, sinkb); + gst_object_unref (sinka_target); + gst_object_unref (sinkb_target); + gst_object_unref (src_target); + /* set up interpolation */ g_object_set (target, propname, (gfloat) 0.0, NULL); @@ -369,6 +377,11 @@ create_audio_bin (GESTrackTransition * self) /* set up interpolation */ + gst_object_unref (sinka_target); + gst_object_unref (sinkb_target); + gst_object_unref (src_target); + + //g_object_set(atarget, propname, (gdouble) 0, NULL); //g_object_set(btarget, propname, (gdouble) 0, NULL);