[vlc-devel] [PATCH 2/2] opengl: Avoid getting GL symbols directly for GLES to avoid override

Paul Kocialkowski paul.kocialkowski at bootlin.com
Tue May 22 16:32:44 CEST 2018

Since some gl-prefixed functions are common between GLES and GL, it may
occur that these symbols get overridden when loading one library after
the other. More specifically, it happens when loading video output
modules (that use GLES) and the Qt interface (that may use GL instead of
GLES) in that order. The video output calls to gl* functions then result
in calls to their GL implementations, not GLES (and thus fails because
of the missing context).

Getting the symbols from the GetSymbol callback of the windowing module
ensures that we always get the right symbols.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski at bootlin.com>
 modules/video_output/opengl/vout_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 56f5be7bc3..89aa40b802 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -738,7 +738,7 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     vgl->gl = gl;
-#if defined(USE_OPENGL_ES2) || defined(HAVE_GL_CORE_SYMBOLS)
+#if defined(HAVE_GL_CORE_SYMBOLS)
 #define GET_PROC_ADDR_CORE(name) vgl->vt.name = gl##name
 #define GET_PROC_ADDR_CORE(name) GET_PROC_ADDR_EXT(name, true)

More information about the vlc-devel mailing list