]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
Variables fixes
[vlc] / src / libvlc.c
index 0addd3db115c26a90808ee6e1943224d1bced005..5cb74d8946c4b58399a0dd51852f2d6f45d8ec60 100644 (file)
@@ -201,6 +201,10 @@ void vlc_release (gc_object_t *p_gc)
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
+#if defined( ENABLE_NLS ) && (defined (__APPLE__) || defined (WIN32)) && \
+    ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
+static void SetLanguage   ( char const * );
+#endif
 static int  GetFilenames  ( libvlc_int_t *, int, const char *[] );
 static void Help          ( libvlc_int_t *, char const *psz_help_name );
 static void Usage         ( libvlc_int_t *, char const *psz_search );
@@ -340,9 +344,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
         i_ret = VLC_EEXITSUCCESS;
     }
 
-    /* Check for plugins cache options */
-    bool b_cache_delete = var_InheritBool( p_libvlc, "reset-plugins-cache" );
-
     /* Check for daemon mode */
 #ifndef WIN32
     if( var_InheritBool( p_libvlc, "daemon" ) )
@@ -442,7 +443,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
      * list of configuration options exported by each module and loads their
      * default values.
      */
-    module_LoadPlugins( p_libvlc, b_cache_delete );
+    module_LoadPlugins( p_libvlc );
     if( p_libvlc->b_die )
     {
         b_exit = true;
@@ -806,14 +807,16 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     playlist_Activate( p_playlist );
 
     /* Add service discovery modules */
-    psz_modules = var_CreateGetNonEmptyString( p_playlist, "services-discovery" );
+    psz_modules = var_InheritString( p_libvlc, "services-discovery" );
     if( psz_modules )
     {
         char *p = psz_modules, *m;
+        playlist_t *p_playlist = pl_Hold( p_libvlc );
         while( ( m = strsep( &p, " :," ) ) != NULL )
             playlist_ServicesDiscoveryAdd( p_playlist, m );
+        free( psz_modules );
+        pl_Release (p_playlist);
     }
-    free( psz_modules );
 
 #ifdef ENABLE_VLM
     /* Initialize VLM if vlm-conf is specified */
@@ -923,7 +926,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
 #ifdef WIN32
     if( var_InheritBool( p_libvlc, "prefer-system-codecs") )
     {
-        char *psz_codecs = var_CreateGetNonEmptyString( p_playlist, "codec" );
+        char *psz_codecs = var_CreateGetNonEmptyString( p_libvlc, "codec" );
         if( psz_codecs )
         {
             char *psz_morecodecs;
@@ -964,15 +967,15 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     /*
      * Get --open argument
      */
-    psz_val = var_CreateGetNonEmptyString( p_libvlc, "open" );
+    psz_val = var_InheritString( p_libvlc, "open" );
     if ( psz_val != NULL )
     {
         playlist_t *p_playlist = pl_Hold( p_libvlc );
         playlist_AddExt( p_playlist, psz_val, NULL, PLAYLIST_INSERT, 0,
                          -1, 0, NULL, 0, true, pl_Unlocked );
         pl_Release( p_libvlc );
+        free( psz_val );
     }
-    free( psz_val );
 
     return VLC_SUCCESS;
 }