[vlc-commits] [Git][videolan/vlc][master] input: add stats-min-report-interval instead of fixed rate
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Thu Jan 16 21:13:25 UTC 2025
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
5a32d3bf by François Cartegnie at 2025-01-16T20:58:12+00:00
input: add stats-min-report-interval instead of fixed rate
Aiming at tests using reporting events in realtime.
Allows finer reporting, or per sample, instead of fixed interval.
- - - - -
2 changed files:
- src/input/input.c
- src/libvlc-module.c
Changes:
=====================================
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;
}
}
=====================================
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,
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5a32d3bfc004476754bd09ae3180a1aed86fcfc0
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5a32d3bfc004476754bd09ae3180a1aed86fcfc0
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list