]> git.sesse.net Git - vlc/commitdiff
core: do not squash VLC_VERBOSE environment variable setting
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 23 Aug 2012 09:23:03 +0000 (12:23 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 23 Aug 2012 09:24:00 +0000 (12:24 +0300)
It did not work at all anymore.

src/libvlc.c

index 218bc0d48c902b979da9cdac7e43992e99b8179b..8aa63af9f73d28e59c36d5c1031c2c6330b804c6 100644 (file)
@@ -102,7 +102,6 @@ libvlc_int_t * libvlc_InternalCreate( void )
 {
     libvlc_int_t *p_libvlc;
     libvlc_priv_t *priv;
-    char *psz_env = NULL;
 
     /* Now that the thread system is initialized, we don't have much, but
      * at least we have variables */
@@ -117,13 +116,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
     priv->p_ml = NULL;
     priv->p_dialog_provider = NULL;
     priv->p_vlm = NULL;
-
-    /* Find verbosity from VLC_VERBOSE environment variable */
-    psz_env = getenv( "VLC_VERBOSE" );
-    if( psz_env != NULL )
-        priv->i_verbose = atoi( psz_env );
-    else
-        priv->i_verbose = 3;
+    priv->i_verbose = 3; /* initial value until config is loaded */
 #if defined( HAVE_ISATTY ) && !defined( WIN32 )
     priv->b_color = isatty( STDERR_FILENO ); /* 2 is for stderr */
 #else
@@ -172,6 +165,13 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     }
     priv->i_verbose = var_InheritInteger( p_libvlc, "verbose" );
 
+    /* Find verbosity from VLC_VERBOSE environment variable */
+    {
+        char *env = getenv( "VLC_VERBOSE" );
+        if( env != NULL )
+            priv->i_verbose = atoi( env );
+    }
+
     /* Announce who we are (TODO: only first instance?) */
     msg_Dbg( p_libvlc, "VLC media player - %s", VERSION_MESSAGE );
     msg_Dbg( p_libvlc, "%s", COPYRIGHT_MESSAGE );