]> git.sesse.net Git - vlc/commitdiff
system_Configure: do not depend on vlc_optind global
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 29 Mar 2010 20:49:08 +0000 (23:49 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 29 Mar 2010 20:49:08 +0000 (23:49 +0300)
src/libvlc.c
src/win32/specific.c

index 3217b9be1b88f3cee95120a425269d50118d8f4d..61c296b014ae9b66e8dbc971fdf060a2100bc804 100644 (file)
@@ -818,7 +818,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" );
index 1fb2b2065538891a49364ef068fa273b9910bb8b..e362e273b29263b3d6313d7982ef8317de9c599a 100644 (file)
@@ -221,24 +221,24 @@ void system_Configure( libvlc_int_t *p_this, int i_argc, const char *const ppsz_
 
             /* We assume that the remaining parameters are filenames
              * and their input options */
-            if( i_argc - 1 >= vlc_optind )
+            if( i_argc > 0 )
             {
                 COPYDATASTRUCT wm_data;
                 int i_opt;
                 vlc_ipc_data_t *p_data;
                 size_t i_data = sizeof (*p_data);
 
-                for( i_opt = vlc_optind; i_opt < i_argc; i_opt++ )
+                for( i_opt = 0; i_opt < i_argc; i_opt++ )
                 {
                     i_data += sizeof (size_t);
                     i_data += strlen( ppsz_argv[ i_opt ] ) + 1;
                 }
 
                 p_data = malloc( i_data );
-                p_data->argc = i_argc - vlc_optind;
+                p_data->argc = i_argc;
                 p_data->enqueue = var_InheritBool( p_this, "playlist-enqueue" );
                 i_data = 0;
-                for( i_opt = vlc_optind; i_opt < i_argc; i_opt++ )
+                for( i_opt = 0; i_opt < i_argc; i_opt++ )
                 {
                     size_t i_len = strlen( ppsz_argv[ i_opt ] ) + 1;
                     /* Windows will never switch to an architecture