Commit 5793dfe8 authored by Matthew Waters's avatar Matthew Waters Committed by Tim-Philipp Müller

gltestsrc: free in the GL thread on stop

Calling GL functions not on the GL thread may crash in some GL
implementations.

https://bugzilla.gnome.org/show_bug.cgi?id=789665
parent 77277c46
......@@ -522,31 +522,36 @@ gst_gl_test_src_start (GstBaseSrc * basesrc)
return TRUE;
}
static void
gst_gl_test_src_gl_stop (GstGLContext * context, GstGLTestSrc * src)
{
if (src->fbo)
gst_object_unref (src->fbo);
src->fbo = NULL;
if (src->shader)
gst_object_unref (src->shader);
src->shader = NULL;
if (src->src_impl)
src->src_funcs->free (src->src_impl);
src->src_impl = NULL;
}
static gboolean
gst_gl_test_src_stop (GstBaseSrc * basesrc)
{
GstGLTestSrc *src = GST_GL_TEST_SRC (basesrc);
gst_caps_replace (&src->out_caps, NULL);
if (src->context) {
if (src->shader) {
gst_object_unref (src->shader);
src->shader = NULL;
}
gst_gl_context_thread_add (src->context,
(GstGLContextThreadFunc) gst_gl_test_src_gl_stop, src);
if (src->fbo)
gst_object_unref (src->fbo);
src->fbo = NULL;
gst_caps_replace (&src->out_caps, NULL);
if (src->context)
gst_object_unref (src->context);
src->context = NULL;
}
if (src->src_impl) {
src->src_funcs->free (src->src_impl);
src->src_impl = NULL;
}
src->context = NULL;
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment