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.
This commit is contained in:
Rémi Denis-Courmont 2009-05-06 18:15:27 +03:00
parent 36def77907
commit 0c88710e2c
3 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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