From: Olivier Aubert Date: Mon, 15 Dec 2008 10:44:39 +0000 (+0100) Subject: python bindings: workaround for the #2257 / #2266 VLC bug (linux only ATM) X-Git-Tag: 1.0.0-pre1~1790 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=937e3f2f6b56c287e9acecfc77d65841300325ca;p=vlc python bindings: workaround for the #2257 / #2266 VLC bug (linux only ATM) --- diff --git a/bindings/python/vlc_module.c b/bindings/python/vlc_module.c index 7a90a4ba50..c82e6a0704 100644 --- a/bindings/python/vlc_module.c +++ b/bindings/python/vlc_module.c @@ -22,6 +22,7 @@ *****************************************************************************/ #include "vlcglue.h" +#include /************************************************************************** * VLC Module @@ -47,6 +48,21 @@ initvlc( void ) { PyObject* p_module; +#ifdef WIN32 + /* + FIXME: Win32 support is trickier than that (does not support dlopen). + Get code from src/modules/os.c to work on different OSes. + */ + #define LIBVLCCORE "libvlccore.dll" +#else + #define LIBVLCCORE "libvlccore.so" +#endif + /* Workaround for the 2257/2266 VLC bug. */ + if ( !dlopen( LIBVLCCORE, RTLD_NOW | RTLD_GLOBAL ) ) + { + fprintf( stderr, "Error when loading libvlccore:\n%s\nTrying to continue anyway.\n", dlerror() ); + } + /* vlcMediaPlayer_Type.tp_new = PyType_GenericNew; */ vlcMediaPlayer_Type.tp_alloc = PyType_GenericAlloc; /* vlcMedia_Type.tp_new = PyType_GenericNew; */