Commit 82337d0c authored by Gildas Bazin's avatar Gildas Bazin

* Fixed the warning_level handling: "-v" and "--warning" are now working as
  they should and they also are cumulative (using -vv --warning=3 you end up
  with i_warning_level=5)
parent 497e82b1
......@@ -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 ) \
......
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment