diff --git a/src/input/input.c b/src/input/input.c index 7f32eaa22ce7b506de537b4b93e73b05e3cae5e8..58242179b752785817a2fc8e717121ee678993ac 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -625,6 +625,8 @@ static void MainLoopStatistics( input_thread_t *p_input ) static void MainLoop( input_thread_t *p_input, bool b_interactive ) { vlc_tick_t i_intf_update = 0; + vlc_tick_t i_inf_update_delay = + VLC_TICK_FROM_MS(var_InheritInteger( p_input, "stats-min-report-interval" )); vlc_tick_t i_last_seek_mdate = 0; if( b_interactive && var_InheritBool( p_input, "start-paused" ) ) @@ -697,7 +699,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive ) if( now >= i_intf_update ) { MainLoopStatistics( p_input ); - i_intf_update = now + VLC_TICK_FROM_MS(250); + i_intf_update = now + i_inf_update_delay; } } diff --git a/src/libvlc-module.c b/src/libvlc-module.c index 832eddd722fa7c069fac0e35d0042f98a5c71eba..7b24b8f4c647f9603bc1b824b3e33bdf247c9e79 100644 --- a/src/libvlc-module.c +++ b/src/libvlc-module.c @@ -1119,6 +1119,10 @@ static const char* const ppsz_restore_playback_desc[] = { #define STATS_LONGTEXT N_( \ "Collect miscellaneous local statistics about the playing media.") +#define STATSFREQ_TEXT N_("Statistics collection frequency") +#define STATSFREQ_LONGTEXT N_( \ + "Collection frequency of the statistics in ms.") + #define ONEINSTANCE_TEXT N_("Allow only one running instance") #define ONEINSTANCE_LONGTEXT N_( \ "Allowing only one running instance of VLC can sometimes be useful, " \ @@ -2227,6 +2231,9 @@ vlc_module_begin () INTERACTION_LONGTEXT ) add_bool ( "stats", true, STATS_TEXT, STATS_LONGTEXT ) + add_integer( "stats-min-report-interval", 250, + STATSFREQ_TEXT, STATSFREQ_LONGTEXT ); + change_integer_range( 0, INT32_MAX ) set_subcategory( SUBCAT_INTERFACE_MAIN ) add_module_cat("intf", SUBCAT_INTERFACE_MAIN, NULL,