From: Wim Taymans Date: Wed, 5 Aug 2009 11:41:33 +0000 (+0200) Subject: ghostpad: small improvements X-Git-Tag: RELEASE-0.10.25~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b26e0c6005519f8b2ac9a5b7e426b3f05cbcd70;p=platform%2Fupstream%2Fgstreamer.git ghostpad: small improvements Unref the target pad after we used it for debugging. Add some more debug. Only replace caps when they changed. --- diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 18256c8..fff278a 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -225,11 +225,12 @@ gst_proxy_pad_do_getcaps (GstPad * pad) if (target) { /* if we have a real target, proxy the call */ res = gst_pad_get_caps (target); - gst_object_unref (target); GST_DEBUG_OBJECT (pad, "get caps of target %s:%s : %" GST_PTR_FORMAT, GST_DEBUG_PAD_NAME (target), res); + gst_object_unref (target); + /* filter against the template */ if (templ && res) { GstCaps *filt, *tmp; @@ -688,6 +689,8 @@ on_int_notify (GstPad * internal, GParamSpec * unused, GstGhostPad * pad) g_object_get (internal, "caps", &caps, NULL); + GST_DEBUG_OBJECT (pad, "notified %p %" GST_PTR_FORMAT, caps, caps); + GST_OBJECT_LOCK (pad); changed = (GST_PAD_CAPS (pad) != caps); if (changed) @@ -709,9 +712,12 @@ on_src_target_notify (GstPad * target, GParamSpec * unused, GstGhostPad * pad) g_object_get (target, "caps", &caps, NULL); + GST_DEBUG_OBJECT (pad, "notified %p %" GST_PTR_FORMAT, caps, caps); + GST_OBJECT_LOCK (pad); changed = (GST_PAD_CAPS (pad) != caps); - gst_caps_replace (&(GST_PAD_CAPS (pad)), caps); + if (changed) + gst_caps_replace (&(GST_PAD_CAPS (pad)), caps); GST_OBJECT_UNLOCK (pad); if (changed)