#endif
static int ConsoleWidth ( void );
-static int VerboseCallback( vlc_object_t *, char const *,
- vlc_value_t, vlc_value_t, void * );
-
static void InitDeviceValues( libvlc_int_t * );
static vlc_mutex_t global_lock = VLC_STATIC_MUTEX;
if( config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, true ) )
{
- module_EndBank( p_libvlc );
+ module_EndBank( p_libvlc, false );
return VLC_EGENERIC;
}
if( b_exit )
{
free( priv->psz_configfile );
- module_EndBank( p_libvlc );
+ module_EndBank( p_libvlc, false );
return i_ret;
}
if( !config_GetInt( p_libvlc, "ignore-config" ) )
config_LoadConfigFile( p_libvlc, "main" );
config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, true );
+ priv->i_verbose = config_GetInt( p_libvlc, "verbose" );
/* Check if the user specified a custom language */
psz_language = config_GetPsz( p_libvlc, "language" );
/* Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
msg_Dbg( p_libvlc, "translation test: code is \"%s\"", _("C") );
- module_EndBank( p_libvlc );
+ module_EndBank( p_libvlc, false );
module_InitBank( p_libvlc );
if( !config_GetInt( p_libvlc, "ignore-config" ) )
config_LoadConfigFile( p_libvlc, "main" );
config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, true );
+ priv->i_verbose = config_GetInt( p_libvlc, "verbose" );
}
free( psz_language );
# endif
* list of configuration options exported by each module and loads their
* default values.
*/
- module_LoadBuiltins( p_libvlc );
module_LoadPlugins( p_libvlc, b_cache_delete );
if( p_libvlc->b_die )
{
if( b_exit )
{
free( priv->psz_configfile );
- module_EndBank( p_libvlc );
+ module_EndBank( p_libvlc, true );
return i_ret;
}
PauseConsole();
#endif
free( priv->psz_configfile );
- module_EndBank( p_libvlc );
+ module_EndBank( p_libvlc, true );
return VLC_EGENERIC;
}
+ priv->i_verbose = config_GetInt( p_libvlc, "verbose" );
/*
* System specific configuration
msg_Err( p_libvlc, "verbose-objects usage: \n"
"--verbose-objects=+printthatobject,"
"-dontprintthatone\n"
- "(keyword 'all' to applies to all objects)\n");
+ "(keyword 'all' to applies to all objects)");
free( psz_verbose_objects );
/* FIXME: leaks!!!! */
return VLC_EGENERIC;
free( psz_verbose_objects );
}
+ /* Last chance to set the verbosity. Once we start interfaces and other
+ * threads, verbosity becomes read-only. */
var_Create( p_libvlc, "verbose", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
if( config_GetInt( p_libvlc, "quiet" ) > 0 )
{
- val.i_int = -1;
- var_Set( p_libvlc, "verbose", val );
+ var_SetInteger( p_libvlc, "verbose", -1 );
+ priv->i_verbose = -1;
}
- var_AddCallback( p_libvlc, "verbose", VerboseCallback, NULL );
- var_TriggerCallback( p_libvlc, "verbose" );
if( priv->b_color )
priv->b_color = config_GetInt( p_libvlc, "color" ) > 0;
priv->i_timers = 0;
priv->pp_timers = NULL;
- /* Init stats */
- p_libvlc->p_stats = (global_stats_t *)malloc( sizeof( global_stats_t ) );
- if( !p_libvlc->p_stats )
- {
- vlc_object_release( p_libvlc );
- return VLC_ENOMEM; /* FIXME: leaks */
- }
- vlc_mutex_init( &p_libvlc->p_stats->lock );
- priv->p_stats_computer = NULL;
-
priv->i_last_input_id = 0; /* Not very safe, should be removed */
/*
{
module_unneed( p_libvlc, priv->p_memcpy_module );
}
- module_EndBank( p_libvlc );
+ module_EndBank( p_libvlc, true );
free( priv->psz_configfile );
return VLC_EGENERIC;
}
/*
* FIXME: kludge to use a p_libvlc-local variable for the Mozilla plugin
*/
+ var_Create( p_libvlc, "drawable-xid", VLC_VAR_INTEGER );
+ var_Create( p_libvlc, "drawable-hwnd", VLC_VAR_ADDRESS );
+#ifdef __APPLE__
var_Create( p_libvlc, "drawable", VLC_VAR_INTEGER );
+#endif
var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER );
var_Create( p_libvlc, "drawable-view-bottom", VLC_VAR_INTEGER );
stats_TimersCleanAll( p_libvlc );
msg_Dbg( p_libvlc, "removing stats" );
- vlc_mutex_destroy( &p_libvlc->p_stats->lock );
- FREENULL( p_libvlc->p_stats );
#ifndef WIN32
char* psz_pidfile = NULL;
}
/* Free module bank. It is refcounted, so we call this each time */
- module_EndBank( p_libvlc );
+ module_EndBank( p_libvlc, true );
FREENULL( priv->psz_configfile );
var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action,
utf8_fprintf( stdout, _("Compiled by %s@%s.%s\n"),
VLC_CompileBy(), VLC_CompileHost(), VLC_CompileDomain() );
utf8_fprintf( stdout, _("Compiler: %s\n"), VLC_Compiler() );
- if( strcmp( VLC_Changeset(), "exported" ) )
- utf8_fprintf( stdout, _("Based upon Git commit [%s]\n"),
- VLC_Changeset() );
utf8_fprintf( stdout, LICENSE_MSG );
#ifdef WIN32 /* Pause the console because it's destroyed when we exit */
return i_width;
}
-static int VerboseCallback( vlc_object_t *p_this, const char *psz_variable,
- vlc_value_t old_val, vlc_value_t new_val, void *param)
-{
- libvlc_int_t *p_libvlc = (libvlc_int_t *)p_this;
- (void)psz_variable;
- (void)old_val;
- (void)param;
-
- if( new_val.i_int >= -1 )
- {
- libvlc_priv (p_libvlc)->i_verbose = __MIN( new_val.i_int, 2 );
- }
- return VLC_SUCCESS;
-}
-
/*****************************************************************************
* InitDeviceValues: initialize device values
*****************************************************************************