]> git.sesse.net Git - vlc/commitdiff
core/mediacontrol_core.c: do not prepend the dummy argv[0] since it is
authorOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Fri, 16 Nov 2007 18:59:19 +0000 (18:59 +0000)
committerOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Fri, 16 Nov 2007 18:59:19 +0000 (18:59 +0000)
 done in libvlc_new now (since r22749)

src/control/mediacontrol_core.c

index 48fd354915bffd8d63d027bb2ffd843555f413b2..ff14d06b99df6edc84f63f806b972d29ce978b21 100644 (file)
@@ -55,8 +55,6 @@ mediacontrol_Instance* mediacontrol_new( int argc, char** argv, mediacontrol_Exc
 {
     mediacontrol_Instance* retval;
     libvlc_exception_t ex;
-    char** ppsz_argv = NULL;
-    int i_index;
 
     libvlc_exception_init( &ex );
     mediacontrol_exception_init( exception );
@@ -65,22 +63,11 @@ mediacontrol_Instance* mediacontrol_new( int argc, char** argv, mediacontrol_Exc
     if( !retval )
         RAISE_NULL( mediacontrol_InternalException, "Out of memory" );
 
-    /* Prepend a dummy argv[0] so that users of the API do not have to
-       do it themselves, and can simply provide the args list. */
-    ppsz_argv = malloc( ( argc + 2 ) * sizeof( char * ) ) ;
-    if( ! ppsz_argv )
-        RAISE_NULL( mediacontrol_InternalException, "Out of memory" );
-
-    ppsz_argv[0] = strdup("vlc");
-    for ( i_index = 0; i_index < argc; i_index++ )
-        ppsz_argv[i_index + 1] = argv[i_index];
-    ppsz_argv[argc + 1] = NULL;
-
-    retval->p_instance = libvlc_new( argc + 1, ppsz_argv, &ex );
-    retval->p_playlist = retval->p_instance->p_libvlc_int->p_playlist;
+    retval->p_instance = libvlc_new( argc, argv, &ex );
     HANDLE_LIBVLC_EXCEPTION_NULL( &ex );
+    retval->p_playlist = retval->p_instance->p_libvlc_int->p_playlist;
     return retval;
-};
+}
 
 void
 mediacontrol_exit( mediacontrol_Instance *self )