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
This commit is contained in:
Lubosz Sarnecki 2015-04-21 09:43:58 +02:00 committed by Tim-Philipp Müller
parent c75f6b347f
commit 590c7032d8

View file

@ -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,