fsvalve: Dont hold the object lock while calling base alloc function

20071219203230-3e2dc-6519175d8d81496515b2d9060ac316650560f691.gz
This commit is contained in:
Olivier Crete 2007-12-19 20:32:30 +00:00 committed by Tim-Philipp Müller
parent 8362bb9275
commit e384295df0

View file

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