From 634ff541d048fe30232f5a1ea2d59fc24a8a810b Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 12 Jun 2019 17:20:10 +0200 Subject: [PATCH] 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. --- gst-libs/gst/gl/gstglcontext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 4fc9fc8..a073fc7 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -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) -- 2.7.4