libs/gst/base/gstbasesink.c: Don't hold the object lock when unreffing a buffer because it could cause a deadlock whe...

Original commit message from CVS:
* libs/gst/base/gstbasesink.c: (gst_base_sink_set_last_buffer):
Don't hold the object lock when unreffing a buffer because it could
cause a deadlock when the finalize function wants to grab the object
lock too. Fixes #495133.
This commit is contained in:
Wim Taymans 2007-11-09 14:05:02 +00:00
parent c28238d8fe
commit 2c51884bb8
2 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2007-11-09 Wim Taymans <wim.taymans@gmail.com>
* libs/gst/base/gstbasesink.c: (gst_base_sink_set_last_buffer):
Don't hold the object lock when unreffing a buffer because it could
cause a deadlock when the finalize function wants to grab the object
lock too. Fixes #495133.
2007-11-09 Wim Taymans <wim.taymans@gmail.com>
* gst/gstsegment.c: (gst_segment_set_newsegment_full),

View file

@ -834,9 +834,18 @@ gst_base_sink_get_last_buffer (GstBaseSink * sink)
static void
gst_base_sink_set_last_buffer (GstBaseSink * sink, GstBuffer * buffer)
{
GstBuffer *old;
if (buffer)
gst_buffer_ref (buffer);
GST_OBJECT_LOCK (sink);
gst_buffer_replace (&sink->priv->last_buffer, buffer);
old = sink->priv->last_buffer;
sink->priv->last_buffer = buffer;
GST_OBJECT_UNLOCK (sink);
if (old)
gst_buffer_unref (old);
}
/**