[vlc-commits] core: do not squash VLC_VERBOSE environment variable setting

Rémi Denis-Courmont git at videolan.org
Thu Aug 23 11:24:04 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 23 12:23:03 2012 +0300| [c6f168ffcdd31fbdec00f30059a3c6ec98b95f92] | committer: Rémi Denis-Courmont

core: do not squash VLC_VERBOSE environment variable setting

It did not work at all anymore.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c6f168ffcdd31fbdec00f30059a3c6ec98b95f92
---

 src/libvlc.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 218bc0d..8aa63af 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -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 );



More information about the vlc-commits mailing list