From 5973f8c2cafc40e1d3d00f6b00e39a2886db9655 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 6 Mar 2014 13:01:40 +0200 Subject: [PATCH] ghostpad: use gst_pad_get_peer to acquire a reference to the target pad This ensures that the lock of the internal pad is held while referencing it's peer (= the target pad), which ensures that the peer is not going to be unlinked/destroyed in the meantime. https://bugzilla.gnome.org/show_bug.cgi?id=725809 --- gst/gstghostpad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 47e9dce2da..f6952cb99f 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -195,9 +195,7 @@ gst_proxy_pad_get_target (GstPad * pad) GstPad *target; GST_OBJECT_LOCK (pad); - target = GST_PROXY_PAD_TARGET (pad); - if (target) - gst_object_ref (target); + target = gst_pad_get_peer (GST_PROXY_PAD_INTERNAL (pad)); GST_OBJECT_UNLOCK (pad); return target;