summaryrefslogtreecommitdiff
path: root/gst/gstghostpad.c
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2014-03-06 13:01:40 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-03-06 20:46:28 +0100
commit5973f8c2cafc40e1d3d00f6b00e39a2886db9655 (patch)
tree7579fae9849a3749fd61e3dac8d90c67bc7f2dd9 /gst/gstghostpad.c
parent4fc671e801c64d8ea329bf2a29485240db3f0bc3 (diff)
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
Diffstat (limited to 'gst/gstghostpad.c')
-rw-r--r--gst/gstghostpad.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c
index 47e9dce2d..f6952cb99 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;