glimagesink: unref the old buffer outside the lock

it could very well deadlock

https://bugzilla.gnome.org/show_bug.cgi?id=723529
This commit is contained in:
Matthew Waters 2014-05-30 11:46:00 +10:00
parent 1cb7e22b98
commit 5eb4934750

View file

@ -759,6 +759,7 @@ static GstFlowReturn
gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
{
GstGLImageSink *glimage_sink;
GstBuffer *stored_buffer;
GST_TRACE ("rendering buffer:%p", buf);
@ -773,8 +774,11 @@ gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
/* Avoid to release the texture while drawing */
GST_GLIMAGE_SINK_LOCK (glimage_sink);
glimage_sink->redisplay_texture = glimage_sink->next_tex;
gst_buffer_replace (&glimage_sink->stored_buffer, buf);
stored_buffer = glimage_sink->stored_buffer;
glimage_sink->stored_buffer = gst_buffer_ref (buf);
GST_GLIMAGE_SINK_UNLOCK (glimage_sink);
if (stored_buffer)
gst_buffer_unref (stored_buffer);
/* Ask the underlying window to redraw its content */
if (!gst_glimage_sink_redisplay (glimage_sink))