From c6f168ffcdd31fbdec00f30059a3c6ec98b95f92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 23 Aug 2012 12:23:03 +0300 Subject: [PATCH] core: do not squash VLC_VERBOSE environment variable setting It did not work at all anymore. --- src/libvlc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libvlc.c b/src/libvlc.c index 218bc0d48c..8aa63af9f7 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 ); -- 2.39.2