[vlc-commits] EGL: remove the dlopen() hack

Rémi Denis-Courmont git at videolan.org
Sun Feb 20 17:25:39 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 20 18:22:28 2011 +0200| [b96cba4c0b234324046f2fd199a662a7ce6cb7dd] | committer: Rémi Denis-Courmont

EGL: remove the dlopen() hack

It only worked for non-ES OpenGL and if the libGL development files
were installed (otherwise "libGL.so" does not exist). So let Mesa fix
their bugs and stop caring about them:
https://bugs.freedesktop.org/show_bug.cgi?id=34476

In the mean time, you can use VLC and EGL with:

 # LD_PRELOAD=/usr/lib/libGL.so vlc

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

 modules/video_output/Modules.am |    2 +-
 modules/video_output/egl.c      |   15 ---------------
 2 files changed, 1 insertions(+), 16 deletions(-)

diff --git a/modules/video_output/Modules.am b/modules/video_output/Modules.am
index ce7c0c8..2db873f 100644
--- a/modules/video_output/Modules.am
+++ b/modules/video_output/Modules.am
@@ -115,7 +115,7 @@ libegl_plugin_la_SOURCES = egl.c
 libegl_plugin_la_CFLAGS = $(AM_CFLAGS) $(EGL_CFLAGS)
 libegl_plugin_la_LIBADD = $(AM_LIBADD) $(EGL_LIBS)
 if !HAVE_WIN32
-libegl_plugin_la_LIBADD += -ldl $(X_LIBS) $(X_PRE_LIBS) -lX11
+libegl_plugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIBS) -lX11
 endif
 libegl_plugin_la_DEPENDENCIES =
 EXTRA_LTLIBRARIES += libegl_plugin.la
diff --git a/modules/video_output/egl.c b/modules/video_output/egl.c
index 2e43b3a..f7f0960 100644
--- a/modules/video_output/egl.c
+++ b/modules/video_output/egl.c
@@ -34,7 +34,6 @@
 #include <vlc_vout_window.h>
 #ifdef __unix__
 # include <vlc_xlib.h>
-# include <dlfcn.h>
 #endif
 
 /* Plugin callbacks */
@@ -127,20 +126,6 @@ static int Open (vlc_object_t *obj, const struct gl_api *api)
     gl->sys = sys;
     sys->display = dpy;
 
-#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
-     * typically not a problem. Unfortunately, LibVLC loads plugins as
-     * 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. */
-    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;
     if (eglInitialize (dpy, &major, &minor) != EGL_TRUE)
     {



More information about the vlc-commits mailing list