From 51daa8b9e2b351055ce59ed89b0417ff9f7dccb9 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Tue, 21 Apr 2015 09:43:58 +0200 Subject: [PATCH] gltransformation: don't initialize multiple shaders on renegotiation https://bugzilla.gnome.org/show_bug.cgi?id=748407 * delete shader if one exists * set it to NULL after unrefing --- ext/gl/gstgltransformation.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/gl/gstgltransformation.c b/ext/gl/gstgltransformation.c index 4175c39e35..f112d9e13f 100644 --- a/ext/gl/gstgltransformation.c +++ b/ext/gl/gstgltransformation.c @@ -406,6 +406,7 @@ gst_gl_transformation_reset_gl (GstGLFilter * filter) } gst_object_unref (transformation->shader); + transformation->shader = NULL; } static void @@ -425,6 +426,11 @@ gst_gl_transformation_init_shader (GstGLFilter * filter) { GstGLTransformation *transformation = GST_GL_TRANSFORMATION (filter); + if (transformation->shader) { + gst_object_unref (transformation->shader); + transformation->shader = NULL; + } + if (gst_gl_context_get_gl_api (GST_GL_BASE_FILTER (filter)->context)) { /* blocking call, wait until the opengl thread has compiled the shader */ return gst_gl_context_gen_shader (GST_GL_BASE_FILTER (filter)->context,