[vlc-commits] EGL: need to load libGL too...

Rémi Denis-Courmont git at videolan.org
Sat Feb 19 14:16:38 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 19 15:14:51 2011 +0200| [801fcb35dffeadd8dbb8201f2898d83004ef338b] | committer: Rémi Denis-Courmont

EGL: need to load libGL too...

Why can't Mesa people link their shared objects correctly!?

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=801fcb35dffeadd8dbb8201f2898d83004ef338b
---

 modules/video_output/egl.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/egl.c b/modules/video_output/egl.c
index 6430b4c..46a2ae9 100644
--- a/modules/video_output/egl.c
+++ b/modules/video_output/egl.c
@@ -3,7 +3,7 @@
  * @brief EGL video output module
  */
 /*****************************************************************************
- * Copyright © 2010 Rémi Denis-Courmont
+ * Copyright © 2010-2011 Rémi Denis-Courmont
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -161,6 +161,7 @@ static int Open (vlc_object_t *obj)
     sys->gl.sys = NULL;
     sys->pool = NULL;
 
+#ifdef __unix__
     /* XXX Explicit hack!
      * Mesa EGL plugins (as of version 7.8.2) are not properly linked to
      * libEGL.so even though they import some of its symbols. This is
@@ -168,8 +169,10 @@ static int Open (vlc_object_t *obj)
      * RTLD_LOCAL so that they do not pollute the namespace. Then the
      * libEGL symbols are not visible to EGL plugins, and the run-time
      * linker exits the whole process. */
-#ifdef __unix__
-    dlopen ("libEGL.so", RTLD_GLOBAL|RTLD_LAZY);
+    if (dlopen ("libEGL.so", RTLD_GLOBAL|RTLD_NOW) == NULL)
+        msg_Warn (gl, "libEGL cannot be loaded. Process might crash.");
+    if (dlopen ("libGL.so", RTLD_GLOBAL|RTLD_NOW) == NULL)
+        msg_Warn (gl, "libGL cannot be loaded. Process might crash.");
 #endif
 
     EGLint major, minor;



More information about the vlc-commits mailing list