X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Flibvlc.c;h=b5c87332e7b2a606563a28e28615942c1761b628;hb=bca37187e25478ac893fbd29e2f48943fc4ecf38;hp=3217b9be1b88f3cee95120a425269d50118d8f4d;hpb=6a0c1f900400949e9bbe8b3ee2bd9acd187a2f48;p=vlc diff --git a/src/libvlc.c b/src/libvlc.c index 3217b9be1b..b5c87332e7 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -321,7 +321,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, * options) */ module_InitBank( p_libvlc ); - if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, true ) ) + if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, NULL ) ) { module_EndBank( p_libvlc, false ); return VLC_EGENERIC; @@ -534,10 +534,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, /* * Override configuration with command line settings */ - /* config_LoadCmdLine(), DBus (below) and Win32-specific use vlc_optind, - * vlc_optarg and vlc_optopt globals. This is not thread-safe!! */ -#warning BUG! - if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, false ) ) + int vlc_optind; + if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, &vlc_optind ) ) { #ifdef WIN32 ShowConsole( false ); @@ -818,7 +816,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, } /* System specific configuration */ - system_Configure( p_libvlc, i_argc, ppsz_argv ); + system_Configure( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind ); /* Add service discovery modules */ psz_modules = var_InheritString( p_libvlc, "services-discovery" ); @@ -966,7 +964,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, * We assume that the remaining parameters are filenames * and their input options. */ - msg_Info( p_libvlc, "optind = %u", vlc_optind ); GetFilenames( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind ); /*