]> git.sesse.net Git - vlc/commitdiff
* ./src/libvlc.c, ./src/misc/messages.c: due to horrible user threats,
authorSam Hocevar <sam@videolan.org>
Tue, 8 Oct 2002 18:10:10 +0000 (18:10 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 8 Oct 2002 18:10:10 +0000 (18:10 +0000)
    only two levels of -v are now possible: -v for warnings, -vv for debug
    messages (-q for no output at all).

src/libvlc.c
src/libvlc.h
src/misc/configuration.c
src/misc/messages.c
src/misc/modules.c
src/vlc.c

index df45694bbd726b1a6341129aa663e06a7b0802e0..3d52bdf29f9666dc3fa4becabf2f189ed2eb18eb 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.c: main libvlc source
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.36 2002/10/04 18:07:22 sam Exp $
+ * $Id: libvlc.c,v 1.37 2002/10/08 18:10:09 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -165,7 +165,7 @@ vlc_t * vlc_create_r( void )
 
         /* Find verbosity from VLC_VERBOSE environment variable */
         psz_env = getenv( "VLC_VERBOSE" );
-        libvlc.i_verbose = psz_env ? atoi( psz_env ) : 0;
+        libvlc.i_verbose = psz_env ? atoi( psz_env ) : -1;
 
 #ifdef HAVE_ISATTY
         libvlc.b_color = isatty( 2 ); /* 2 is for stderr */
@@ -412,14 +412,14 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
      */
     if( config_GetInt( p_vlc, "quiet" ) )
     {
-        libvlc.i_verbose = 0;
+        libvlc.i_verbose = -1;
     }
     else
     {
         int i_tmp = config_GetInt( p_vlc, "verbose" );
         if( i_tmp >= 0 )
         {
-            libvlc.i_verbose = __MIN( i_tmp, 4 );
+            libvlc.i_verbose = __MIN( i_tmp, 2 );
         }
     }
     libvlc.b_color = libvlc.b_color || config_GetInt( p_vlc, "color" );
index 5bcc23455e9aabfd56f83bc0dacbc6d3416ac7c0..8e527f314932007e8d292bfd8ca4bf661b8aa38b 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.h: main libvlc header
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.18 2002/10/05 19:26:23 jlj Exp $
+ * $Id: libvlc.h,v 1.19 2002/10/08 18:10:09 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
     "The default behavior is to automatically select the best module " \
     "available.")
 
-#define VERBOSE_TEXT N_("verbosity (0-4)")
+#define VERBOSE_TEXT N_("verbosity (0,1,2)")
 #define VERBOSE_LONGTEXT N_( \
-    "This options sets the verbosity level (0=no messages, 1=only errors, " \
-    "4=max.")
+    "This options sets the verbosity level (0=only errors and " \
+    "standard messages, 1=warnings, 2=debug.")
 
 #define QUIET_TEXT N_("be quiet")
 #define QUIET_LONGTEXT N_( \
index 28b05564152f9d54b9a5587f7ac3b4e9810b8ec0..eefd41aae8410306396c4e8f6f16a442dd303cae 100644 (file)
@@ -2,7 +2,7 @@
  * configuration.c management of the modules configuration
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.40 2002/10/03 18:56:09 sam Exp $
+ * $Id: configuration.c,v 1.41 2002/10/08 18:10:10 sam Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -883,7 +883,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name )
 int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
                           vlc_bool_t b_ignore_errors )
 {
-    int i_cmd, i_index, i_opts, i_shortopts, flag;
+    int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0;
     module_t **pp_parser;
     vlc_list_t *p_list;
     module_config_t *p_item;
@@ -1115,11 +1115,9 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
             case CONFIG_ITEM_INTEGER:
                 if( i_cmd == 'v' )
                 {
-                    int i_verbose = 0;
-
                     if( optarg )
                     {
-                        if( *optarg == 'v' ) /* eg. -vvvvv */
+                        if( *optarg == 'v' ) /* eg. -vvv */
                         {
                             i_verbose++;
                             while( *optarg == 'v' )
@@ -1135,7 +1133,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
                     }
                     else
                     {
-                        i_verbose = 1; /* -v */
+                        i_verbose++; /* -v */
                     }
                     config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name,
                                            i_verbose );
index be1ac6afe1c2bf8d5e2adbb23bd18eccd481d17e..c1f137cd33dfdacc082077038ef74911751c1fc1 100644 (file)
@@ -4,7 +4,7 @@
  * modules, especially intf modules. See config.h for output configuration.
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: messages.c,v 1.12 2002/10/03 18:56:09 sam Exp $
+ * $Id: messages.c,v 1.13 2002/10/08 18:10:10 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -438,16 +438,16 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
     switch( i_type )
     {
         case VLC_MSG_ERR:
-            if( p_this->p_libvlc->i_verbose < 1 ) return;
+            if( p_this->p_libvlc->i_verbose < 0 ) return;
             break;
         case VLC_MSG_INFO:
-            if( p_this->p_libvlc->i_verbose < 2 ) return;
+            if( p_this->p_libvlc->i_verbose < 0 ) return;
             break;
         case VLC_MSG_WARN:
-            if( p_this->p_libvlc->i_verbose < 3 ) return;
+            if( p_this->p_libvlc->i_verbose < 1 ) return;
             break;
         case VLC_MSG_DBG:
-            if( p_this->p_libvlc->i_verbose < 4 ) return;
+            if( p_this->p_libvlc->i_verbose < 2 ) return;
             break;
     }
 
index ac7f88ef9f2256d417bbfca18d7643e39174bd1f..00f4b315bee53a2fcc4b2c535d11e3075e429bbf 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Builtin and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.95 2002/10/03 18:56:10 sam Exp $
+ * $Id: modules.c,v 1.96 2002/10/08 18:10:10 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -466,8 +466,8 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
 
     if( p_module != NULL )
     {
-        msg_Info( p_module, "using %s module \"%s\"",
-                  psz_capability, p_module->psz_object_name );
+        msg_Dbg( p_module, "using %s module \"%s\"",
+                 psz_capability, p_module->psz_object_name );
     }
     else if( p_first == NULL )
     {
@@ -508,7 +508,7 @@ void __module_Unneed( vlc_object_t * p_this, module_t * p_module )
         p_module->pf_deactivate( p_this );
     }
 
-    msg_Info( p_module, "unlocking module \"%s\"", p_module->psz_object_name );
+    msg_Dbg( p_module, "unlocking module \"%s\"", p_module->psz_object_name );
 
     vlc_object_release( p_module );
 
index db7f4c8707a9ef1d5e3d980ec80d8152eca993bd..7a77b71dc5ee9b0d6319ea419ae41f6e3ee5594a 100644 (file)
--- a/src/vlc.c
+++ b/src/vlc.c
@@ -2,7 +2,7 @@
  * vlc.c: the vlc player
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: vlc.c,v 1.12 2002/10/03 18:56:09 sam Exp $
+ * $Id: vlc.c,v 1.13 2002/10/08 18:10:09 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -59,10 +59,10 @@ int main( int i_argc, char *ppsz_argv[] )
     putenv( "GNOME_DISABLE_CRASH_DIALOG=1" );
 #   endif
 
-    /* If the user isn't using VLC_VERBOSE, set it to 1 by default */
+    /* If the user isn't using VLC_VERBOSE, set it to 0 by default */
     if( getenv( "VLC_VERBOSE" ) == NULL )
     {
-        putenv( "VLC_VERBOSE=1" );
+        putenv( "VLC_VERBOSE=0" );
     }
 #endif