]> git.sesse.net Git - vlc/commitdiff
* Fixed the warning_level handling: "-v" and "--warning" are now working as
authorGildas Bazin <gbazin@videolan.org>
Sun, 21 Apr 2002 21:29:20 +0000 (21:29 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 21 Apr 2002 21:29:20 +0000 (21:29 +0000)
  they should and they also are cumulative (using -vv --warning=3 you end up
  with i_warning_level=5)

src/interface/main.c
src/misc/configuration.c

index 5d4279c0ff362bca42afb3d9d1be99017d60a29d..819e9ab87732de32dcad9894c75e68613ac6aa99 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.183 2002/04/21 18:32:12 sam Exp $
+ * $Id: main.c,v 1.184 2002/04/21 21:29:20 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -522,8 +522,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     p_aout_bank   = &aout_bank;
     p_vout_bank   = &vout_bank;
 
-    p_main->i_warning_level = 0;
-
     /*
      * Support for gettext
      */
@@ -713,8 +711,8 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 #endif
 
     /* p_main inititalization. FIXME ? */
-    p_main->i_desync = (mtime_t)config_GetIntVariable( "desync" )
-      * (mtime_t)1000;
+    p_main->i_warning_level = config_GetIntVariable( "warning" );
+    p_main->i_desync = config_GetIntVariable( "desync" ) * (mtime_t)1000;
     p_main->b_stats = config_GetIntVariable( "stats" );
     p_main->b_audio = !config_GetIntVariable( "noaudio" );
     p_main->b_stereo= !config_GetIntVariable( "mono" );
@@ -733,7 +731,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 
     if( p_main->b_stats )
     {
-        char          p_capabilities[200];
+        char p_capabilities[200];
         p_capabilities[0] = '\0';
 
 #define PRINT_CAPABILITY( capability, string )                              \
index 1cc3b25457a98cee03d97f33364e53c52d0f0362..f10ac717487617e210d8d61c0a3252c0bad41711 100644 (file)
@@ -2,7 +2,7 @@
  * configuration.c management of the modules configuration
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.17 2002/04/21 18:32:12 sam Exp $
+ * $Id: configuration.c,v 1.18 2002/04/21 21:29:20 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -735,6 +735,9 @@ int config_LoadCmdLine( int *pi_argc, char *ppsz_argv[],
     module_config_t *pp_shortopts[256];
     char *psz_shortopts;
 
+    /* reset warning level */
+    p_main->i_warning_level = 0;
+
     /* Set default configuration and copy arguments */
     p_main->i_argc    = *pi_argc;
     p_main->ppsz_argv = ppsz_argv;
@@ -916,13 +919,15 @@ int config_LoadCmdLine( int *pi_argc, char *ppsz_argv[],
         }
     }
 
-    if( p_main->i_warning_level < 0 )
-    {
-        p_main->i_warning_level = 0;
-    }
-
     free( p_longopts );
     free( psz_shortopts );
+
+    /* Update the warning level */
+    p_main->i_warning_level += config_GetIntVariable( "warning" );
+    p_main->i_warning_level = ( p_main->i_warning_level < 0 ) ? 0 :
+        p_main->i_warning_level;
+    config_PutIntVariable( "warning", p_main->i_warning_level );
+
     return( 0 );
 }