]> git.sesse.net Git - vlc/blobdiff - src/libvlc-common.c
Privatize psz_configfile
[vlc] / src / libvlc-common.c
index 5c11207ce8d80b60df016ade03004455a390294d..7be719c8a7ade453df102ebc2b31dff23fd27e29 100644 (file)
@@ -178,11 +178,11 @@ libvlc_int_t * libvlc_InternalCreate( void )
     if( p_libvlc == NULL )
         return NULL;
 
+    priv = libvlc_priv (p_libvlc);
     p_libvlc->p_playlist = NULL;
-    p_libvlc->p_interaction = NULL;
+    priv->p_interaction = NULL;
     priv->p_vlm = NULL;
     p_libvlc->psz_object_name = strdup( "libvlc" );
-    priv = libvlc_priv (p_libvlc);
 
     /* Initialize message queue */
     msg_Create( p_libvlc );
@@ -190,13 +190,13 @@ libvlc_int_t * libvlc_InternalCreate( void )
     /* Find verbosity from VLC_VERBOSE environment variable */
     psz_env = getenv( "VLC_VERBOSE" );
     if( psz_env != NULL )
-        p_libvlc->i_verbose = atoi( psz_env );
+        priv->i_verbose = atoi( psz_env );
     else
-        p_libvlc->i_verbose = 3;
+        priv->i_verbose = 3;
 #if defined( HAVE_ISATTY ) && !defined( WIN32 )
-    p_libvlc->b_color = isatty( 2 ); /* 2 is for stderr */
+    priv->b_color = isatty( 2 ); /* 2 is for stderr */
 #else
-    p_libvlc->b_color = false;
+    priv->b_color = false;
 #endif
 
     /* Announce who we are - Do it only for first instance ? */
@@ -304,7 +304,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     p_libvlc->psz_configdir  = config_GetConfigDir( p_libvlc );
     p_libvlc->psz_datadir    = config_GetUserDataDir( p_libvlc );
     p_libvlc->psz_cachedir   = config_GetCacheDir( p_libvlc );
-    p_libvlc->psz_configfile = config_GetCustomConfigFile( p_libvlc );
+    priv->psz_configfile = config_GetCustomConfigFile( p_libvlc );
 
     /* Check for plugins cache options */
     if( config_GetInt( p_libvlc, "reset-plugins-cache" ) > 0 )
@@ -313,7 +313,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     }
 
     /* Will be re-done properly later on */
-    p_libvlc->i_verbose = config_GetInt( p_libvlc, "verbose" );
+    priv->i_verbose = config_GetInt( p_libvlc, "verbose" );
 
     /* Check for daemon mode */
 #ifndef WIN32
@@ -656,8 +656,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     var_AddCallback( p_libvlc, "verbose", VerboseCallback, NULL );
     var_Change( p_libvlc, "verbose", VLC_VAR_TRIGGER_CALLBACKS, NULL, NULL );
 
-    if( p_libvlc->b_color )
-        p_libvlc->b_color = config_GetInt( p_libvlc, "color" ) > 0;
+    if( priv->b_color )
+        priv->b_color = config_GetInt( p_libvlc, "color" ) > 0;
 
     /*
      * Output messages that may still be in the queue
@@ -740,7 +740,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
                      p_libvlc->p_hotkeys );
 
     /* Initialize interaction */
-    p_libvlc->p_interaction = interaction_Init( p_libvlc );
+    priv->p_interaction = interaction_Init( p_libvlc );
 
     /* Initialize playlist and get commandline files */
     playlist_ThreadCreate( p_libvlc );
@@ -988,7 +988,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
 
     /* Free interaction */
     msg_Dbg( p_libvlc, "removing interaction" );
-    vlc_object_release( p_libvlc->p_interaction );
+    vlc_object_release( priv->p_interaction );
 
     stats_TimersDumpAll( p_libvlc );
     stats_TimersCleanAll( p_libvlc );
@@ -1070,7 +1070,7 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, bool b_release )
     FREENULL( p_libvlc->psz_configdir );
     FREENULL( p_libvlc->psz_datadir );
     FREENULL( p_libvlc->psz_cachedir );
-    FREENULL( p_libvlc->psz_configfile );
+    FREENULL( priv->psz_configfile );
     var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action,
                      p_libvlc->p_hotkeys );
     FREENULL( p_libvlc->p_hotkeys );
@@ -1973,7 +1973,7 @@ static int VerboseCallback( vlc_object_t *p_this, const char *psz_variable,
 
     if( new_val.i_int >= -1 )
     {
-        p_libvlc->i_verbose = __MIN( new_val.i_int, 2 );
+        libvlc_priv (p_libvlc)->i_verbose = __MIN( new_val.i_int, 2 );
     }
     return VLC_SUCCESS;
 }