gst/gstpad.c: Release pad lock before calling out to avoid a possible deadlock.
authorWim Taymans <wim.taymans@gmail.com>
Wed, 14 May 2008 13:52:59 +0000 (13:52 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 14 May 2008 13:52:59 +0000 (13:52 +0000)
Original commit message from CVS:
* gst/gstpad.c: (gst_pad_peer_accept_caps):
Release pad lock before calling out to avoid a possible deadlock.

ChangeLog
gst/gstpad.c

index 8cdc4be..a7e7cb2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-05-14  Wim Taymans  <wim.taymans@collabora.co.uk>
 
+       * gst/gstpad.c: (gst_pad_peer_accept_caps):
+       Release pad lock before calling out to avoid a possible deadlock.
+
+2008-05-14  Wim Taymans  <wim.taymans@collabora.co.uk>
+
        * gst/parse/grammar.y:
        Remove unneeded value unset.
 
index 4a1fa5b..86d7d54 100644 (file)
@@ -2327,9 +2327,14 @@ gst_pad_peer_accept_caps (GstPad * pad, GstCaps * caps)
   if (G_UNLIKELY (peerpad == NULL))
     goto no_peer;
 
-  result = gst_pad_accept_caps (peerpad, caps);
+  gst_object_ref (peerpad);
+  /* release lock before calling external methods but keep ref to pad */
   GST_OBJECT_UNLOCK (pad);
 
+  result = gst_pad_accept_caps (peerpad, caps);
+
+  gst_object_unref (peerpad);
+
   return result;
 
 no_peer: