gl: detect possible GL version prefix

Instead of checking if the requested GL API is GLES2 (because ANY can
be set) the string is matched with the GLES2 prefix, and if so, then
the string is offset.
This commit is contained in:
Víctor Manuel Jáquez Leal 2019-06-12 17:20:10 +02:00
parent 5d51c45b17
commit 634ff541d0

View file

@ -1095,8 +1095,7 @@ _create_context_info (GstGLContext * context, GstGLAPI gl_api, gint * gl_major,
}
opengl_version = (const gchar *) gl->GetString (GL_VERSION);
if (opengl_version && gl_api & GST_GL_API_GLES2)
/* gles starts with "OpenGL ES " */
if (opengl_version && g_str_has_prefix (opengl_version, "OpenGL ES "))
opengl_version = &opengl_version[10];
if (opengl_version)