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
This commit is contained in:
George Kiagiadakis 2014-03-06 13:01:40 +02:00 committed by Tim-Philipp Müller
parent c72ba7e3d9
commit 31597fcd68

View file

@ -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;