From 0c88710e2ccac34ffb971a3531584d0cbd3d739a Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Wed, 6 May 2009 18:15:27 +0300 Subject: [PATCH] Only load globalhotkeys if requested by caller This leaves the choice for bindings to use it or not. I wish we did the same for hotkeys and inhibit but it would break backward libvlc API compatibility. --- bin/vlc.c | 1 + bin/winvlc.c | 1 + src/libvlc.c | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/vlc.c b/bin/vlc.c index 3a15722d77..55f7c5f70f 100644 --- a/bin/vlc.c +++ b/bin/vlc.c @@ -151,6 +151,7 @@ int main( int i_argc, const char *ppsz_argv[] ) libvlc_exception_clear (&ex); pthread_sigmask (SIG_UNBLOCK, &set, NULL); } + libvlc_add_intf (vlc, "globalhotkeys,none", &ex); libvlc_add_intf (vlc, NULL, &ex); libvlc_playlist_play (vlc, -1, 0, NULL, &dummy); libvlc_wait (vlc); diff --git a/bin/winvlc.c b/bin/winvlc.c index e752d080f2..a2d6616252 100644 --- a/bin/winvlc.c +++ b/bin/winvlc.c @@ -147,6 +147,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, vlc = libvlc_new (argc - 1, (const char **)argv + 1, &ex); if (vlc != NULL) { + libvlc_add_intf (vlc, "globalhotkeys,none", &ex); libvlc_add_intf (vlc, NULL, &ex); libvlc_playlist_play (vlc, -1, 0, NULL, &dummy); libvlc_wait (vlc); diff --git a/src/libvlc.c b/src/libvlc.c index d40a0a7e1e..d1aa5f864d 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -904,8 +904,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, * Always load the hotkeys interface if it exists */ libvlc_InternalAddIntf( p_libvlc, "hotkeys,none" ); - if( module_exists( "globalhotkeys" ) ) - libvlc_InternalAddIntf( p_libvlc, "globalhotkeys,none" ); #ifdef HAVE_DBUS /* loads dbus control interface if in one-instance mode -- 2.39.2