[MOVED FROM GST-P-FARSIGHT] Dont hold the object lock while calling base alloc function
authorOlivier Crete <olivier.crete@collabora.co.uk>
Wed, 19 Dec 2007 20:32:30 +0000 (20:32 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 17 Feb 2009 18:29:59 +0000 (19:29 +0100)
20071219203230-3e2dc-6519175d8d81496515b2d9060ac316650560f691.gz

gst/valve/gstvalve.c

index d057b027ac75acacc79f0d67a9a35fabe00e1e8a..a730ca1a74fccff7c757329a3fe18b37232d4b76 100644 (file)
@@ -273,15 +273,17 @@ gst_valve_buffer_alloc (GstPad * pad, guint64 offset, guint size,
   GST_OBJECT_LOCK (GST_OBJECT (valve));
   if (valve->drop)
   {
+    GST_OBJECT_UNLOCK (GST_OBJECT (valve));
     *buf = gst_buffer_new_and_alloc (size);
     GST_BUFFER_OFFSET (*buf) = offset;
     gst_buffer_set_caps (*buf, caps);
   }
   else
   {
-    ret = valve->original_allocfunc (pad, offset, size, caps, buf);
+    GstPadBufferAllocFunction allocfunc = valve->original_allocfunc;
+    GST_OBJECT_UNLOCK (GST_OBJECT (valve));
+    ret = allocfunc (pad, offset, size, caps, buf);
   }
-  GST_OBJECT_UNLOCK (GST_OBJECT (valve));
 
   gst_object_unref (valve);