[MPlayer-cvslog] r29224 - trunk/libvo/gl_common.c

reimar subversion at mplayerhq.hu
Thu Apr 23 12:18:33 CEST 2009


Author: reimar
Date: Thu Apr 23 12:18:32 2009
New Revision: 29224

Log:
Change getdladdr to always use dlopen, dlsym and then dlclose.
Performance is not really important and dlsym(0, ...) is
not defined while the more correct dlsym(RTLD_DEFAULT, ...)
is a GNUism (although POSIX does reserve RTLD_DEFAULT).

Modified:
   trunk/libvo/gl_common.c

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Thu Apr 23 10:46:05 2009	(r29223)
+++ trunk/libvo/gl_common.c	Thu Apr 23 12:18:32 2009	(r29224)
@@ -1536,22 +1536,17 @@ void swapGlBuffers(void) {
  * \brief find address of a linked function
  * \param s name of function to find
  * \return address of function or NULL if not found
- *
- * Copied from xine
  */
 static void *getdladdr(const char *s) {
+  void *ret = NULL;
 #ifdef HAVE_LIBDL
-#if defined(__sun) || defined(__sgi)
-  static void *handle = NULL;
+  void *handle = dlopen(NULL, RTLD_LAZY);
   if (!handle)
-    handle = dlopen(NULL, RTLD_LAZY);
-  return dlsym(handle, s);
-#else
-  return dlsym(0, s);
-#endif
-#else
-  return NULL;
+    return NULL;
+  ret = dlsym(handle, s);
+  dlclose(handle);
 #endif
+  return ret;
 }
 
 /**


More information about the MPlayer-cvslog mailing list