diff options
author | Stas Sergeev <stas@stas.(none)> | 2011-09-02 19:46:06 +0400 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2011-09-07 13:38:47 +0200 |
commit | fcadf09779f7c7f1856dccca90ddae8ac5c72b9e (patch) | |
tree | d8064bc29a4a8f19cdb94b84c21d1127d853fd7c /gst/gstghostpad.c | |
parent | 7079d8c7f4c15d0b3c9ae396862ef1d6e590416c (diff) |
ghostpad: Use gst_pad_set_caps() instead of manually changing caps
gst_pad_set_caps() does essentially the same but additionally calls
the pad's setcaps function.
Fixes bug #658076.
Diffstat (limited to 'gst/gstghostpad.c')
-rw-r--r-- | gst/gstghostpad.c | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 4a024a26e..02d35d370 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -1019,25 +1019,11 @@ static void on_int_notify (GstPad * internal, GParamSpec * unused, GstGhostPad * pad) { GstCaps *caps; - gboolean changed; 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) - gst_caps_replace (&(GST_PAD_CAPS (pad)), caps); - GST_OBJECT_UNLOCK (pad); - - if (changed) { -#if GLIB_CHECK_VERSION(2,26,0) - g_object_notify_by_pspec ((GObject *) pad, pspec_caps); -#else - g_object_notify ((GObject *) pad, "caps"); -#endif - } + gst_pad_set_caps (GST_PAD_CAST (pad), caps); if (caps) gst_caps_unref (caps); @@ -1049,7 +1035,6 @@ on_src_target_notify (GstPad * target, GParamSpec * unused, gpointer user_data) GstProxyPad *proxypad; GstGhostPad *gpad; GstCaps *caps; - gboolean changed; g_object_get (target, "caps", &caps, NULL); @@ -1075,22 +1060,7 @@ on_src_target_notify (GstPad * target, GParamSpec * unused, gpointer user_data) GST_PROXY_UNLOCK (proxypad); GST_OBJECT_UNLOCK (target); - GST_OBJECT_LOCK (gpad); - - GST_DEBUG_OBJECT (gpad, "notified %p %" GST_PTR_FORMAT, caps, caps); - - changed = (GST_PAD_CAPS (gpad) != caps); - if (changed) - gst_caps_replace (&(GST_PAD_CAPS (gpad)), caps); - GST_OBJECT_UNLOCK (gpad); - - if (changed) { -#if GLIB_CHECK_VERSION(2,26,0) - g_object_notify_by_pspec ((GObject *) gpad, pspec_caps); -#else - g_object_notify ((GObject *) gpad, "caps"); -#endif - } + gst_pad_set_caps (GST_PAD_CAST (gpad), caps); g_object_unref (gpad); |