gleffects: only try the GL2 shader init path if we have a GL2 context

This commit is contained in:
Matthew Waters 2015-05-14 14:56:30 +10:00
parent e1b077d6af
commit a852146624

View file

@ -556,13 +556,15 @@ gst_gl_effects_get_fragment_shader (GstGLEffects * effects,
} }
} }
#if GST_GL_HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (!gst_gl_shader_compile_and_check (shader, if (USING_OPENGL (context)) {
shader_source_opengl, GST_GL_SHADER_FRAGMENT_SOURCE)) { if (!gst_gl_shader_compile_and_check (shader,
gst_gl_context_set_error (context, "Failed to initialize %s shader", shader_source_opengl, GST_GL_SHADER_FRAGMENT_SOURCE)) {
shader_name); gst_gl_context_set_error (context, "Failed to initialize %s shader",
GST_ELEMENT_ERROR (effects, RESOURCE, NOT_FOUND, ("%s", shader_name);
gst_gl_context_get_error ()), (NULL)); GST_ELEMENT_ERROR (effects, RESOURCE, NOT_FOUND, ("%s",
return NULL; gst_gl_context_get_error ()), (NULL));
return NULL;
}
} }
#endif #endif
} }