X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fstats.c;h=d6302bd887cc9ca058b0c813834e940486e51a7a;hb=ba75d5221d90168c76fa255eff047ac96724ddd1;hp=1b05c11b24cbb4f8aa3c679097fbafa99fa13309;hpb=a87e722124d2fc8aa8911f7ece1d331ce7d456af;p=vlc diff --git a/src/misc/stats.c b/src/misc/stats.c index 1b05c11b24..d6302bd887 100644 --- a/src/misc/stats.c +++ b/src/misc/stats.c @@ -29,7 +29,7 @@ # include "config.h" #endif -#include +#include #include /* required */ #include "input/input_internal.h" @@ -513,11 +513,12 @@ static int CounterUpdate( vlc_object_t *p_handler, case STATS_DERIVATIVE: { counter_sample_t *p_new, *p_old; - if( mdate() - p_counter->last_update < p_counter->update_interval ) + mtime_t now = mdate(); + if( now - p_counter->last_update < p_counter->update_interval ) { return VLC_EGENERIC; } - p_counter->last_update = mdate(); + p_counter->last_update = now; if( p_counter->i_type != VLC_VAR_FLOAT && p_counter->i_type != VLC_VAR_INTEGER ) {