glimagesink: release stored buffers on drain query

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732694
This commit is contained in:
Julien Isorce 2014-11-11 23:49:59 +00:00 committed by Tim-Philipp Müller
parent af59b771fd
commit c72498af92

View file

@ -564,6 +564,26 @@ gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query)
return gst_gl_handle_context_query ((GstElement *) glimage_sink, query,
&glimage_sink->display, &glimage_sink->other_context);
}
case GST_QUERY_DRAIN:
{
GstBuffer *buf = NULL;
GST_GLIMAGE_SINK_LOCK (glimage_sink);
glimage_sink->redisplay_texture = 0;
buf = glimage_sink->stored_buffer;
glimage_sink->stored_buffer = NULL;
GST_GLIMAGE_SINK_UNLOCK (glimage_sink);
if (buf)
gst_buffer_unref (buf);
gst_buffer_replace (&glimage_sink->next_buffer, NULL);
gst_gl_upload_release_buffer (glimage_sink->upload);
glimage_sink->upload = NULL;
res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
break;
}
default:
res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
break;