]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
httpd: remove commented out debug code
[vlc] / src / libvlc.c
index 7dbda91560aa5656b44b6687b4a9c3d06c7d91e4..21f9d4a1614cb576fb1ecc58bbb5ea53055ac79e 100644 (file)
@@ -101,7 +101,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
         return NULL;
 
     priv = libvlc_priv (p_libvlc);
-    priv->p_playlist = NULL;
+    priv->playlist = NULL;
     priv->p_dialog_provider = NULL;
     priv->p_vlm = NULL;
 
@@ -447,7 +447,7 @@ dbus_out:
         }
         if( asprintf( &psz_temp, "%s,none", psz_module ) != -1)
         {
-            intf_Create( p_libvlc, psz_temp );
+            libvlc_InternalAddIntf( p_libvlc, psz_temp );
             free( psz_temp );
         }
     }
@@ -459,7 +459,7 @@ dbus_out:
     {
         char *logmode = var_CreateGetNonEmptyString( p_libvlc, "logmode" );
         var_SetString( p_libvlc, "logmode", "syslog" );
-        intf_Create( p_libvlc, "logger,none" );
+        libvlc_InternalAddIntf( p_libvlc, "logger,none" );
 
         if( logmode )
         {
@@ -471,12 +471,10 @@ dbus_out:
     else
 #endif
     if( var_InheritBool( p_libvlc, "file-logging" ) )
-        intf_Create( p_libvlc, "logger,none" );
+        libvlc_InternalAddIntf( p_libvlc, "logger,none" );
 
     if( var_InheritBool( p_libvlc, "network-synchronisation") )
-    {
-        intf_Create( p_libvlc, "netsync,none" );
-    }
+        libvlc_InternalAddIntf( p_libvlc, "netsync,none" );
 
 #ifdef __APPLE__
     var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
@@ -506,8 +504,7 @@ dbus_out:
     psz_val = var_InheritString( p_libvlc, "open" );
     if ( psz_val != NULL )
     {
-        playlist_AddExt( pl_Get(p_libvlc), psz_val, NULL, PLAYLIST_INSERT, 0,
-                         -1, 0, NULL, 0, true, pl_Unlocked );
+        intf_InsertItem( p_libvlc, psz_val, 0, NULL, 0 );
         free( psz_val );
     }
 
@@ -535,11 +532,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     }
 #endif
 
-    /* Free playlist now, all threads are gone */
-    playlist_t *p_playlist = libvlc_priv (p_libvlc)->p_playlist;
-    if( p_playlist != NULL )
-        playlist_Destroy( p_playlist );
-
 #if !defined( _WIN32 ) && !defined( __OS2__ )
     char *pidfile = var_InheritString( p_libvlc, "pidfile" );
     if( pidfile != NULL )
@@ -586,39 +578,6 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
     vlc_object_release( p_libvlc );
 }
 
-/**
- * Add an interface plugin and run it
- */
-int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, const char *name )
-{
-    int ret;
-
-    if( !p_libvlc )
-        return VLC_EGENERIC;
-
-    if( name != NULL )
-        ret = intf_Create( p_libvlc, name );
-    else
-    {   /* Default interface */
-        char *intf = var_InheritString( p_libvlc, "intf" );
-        if( intf == NULL ) /* "intf" has not been set */
-        {
-            char *pidfile = var_InheritString( p_libvlc, "pidfile" );
-            if( pidfile != NULL )
-                free( pidfile );
-            else
-                msg_Info( p_libvlc, "%s",
-                          _("Running vlc with the default interface. "
-                            "Use 'cvlc' to use vlc without interface.") );
-        }
-        ret = intf_Create( p_libvlc, intf );
-        name = "default";
-    }
-    if( ret )
-        msg_Err( p_libvlc, "interface \"%s\" initialization failed", name );
-    return ret;
-}
-
 /*****************************************************************************
  * GetFilenames: parse command line options which are not flags
  *****************************************************************************
@@ -651,10 +610,9 @@ static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
                 continue;
         }
 
-        playlist_AddExt( pl_Get( p_vlc ), (mrl != NULL) ? mrl : args[n], NULL,
-                         PLAYLIST_INSERT, 0, -1, i_options,
+        intf_InsertItem( p_vlc, (mrl != NULL) ? mrl : args[n], i_options,
                          ( i_options ? &args[n + 1] : NULL ),
-                         VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );
+                         VLC_INPUT_OPTION_TRUSTED );
         free( mrl );
     }
 }