[vlc-commits] Hard-code stats update interval

Rémi Denis-Courmont git at videolan.org
Tue Nov 29 20:37:51 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 29 20:44:20 2011 +0200| [ef69c0b372f14b46cb2fde368c58d2b5caafced0] | committer: Rémi Denis-Courmont

Hard-code stats update interval

Only 1 second interval has ever been used.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ef69c0b372f14b46cb2fde368c58d2b5caafced0
---

 src/input/input.c |    7 -------
 src/libvlc.h      |    1 -
 src/misc/stats.c  |    3 +--
 3 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 568599d..bfe2e3b 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -872,10 +872,6 @@ static void InitStatistics( input_thread_t * p_input )
         p_input->p->counters.p_sout_send_bitrate = NULL;
         p_input->p->counters.p_sout_sent_packets = NULL;
         p_input->p->counters.p_sout_sent_bytes = NULL;
-        if( p_input->p->counters.p_demux_bitrate )
-            p_input->p->counters.p_demux_bitrate->update_interval = 1000000;
-        if( p_input->p->counters.p_input_bitrate )
-            p_input->p->counters.p_input_bitrate->update_interval = 1000000;
     }
 }
 
@@ -903,9 +899,6 @@ static int InitSout( input_thread_t * p_input )
             INIT_COUNTER( sout_sent_packets, INTEGER, COUNTER );
             INIT_COUNTER( sout_sent_bytes, INTEGER, COUNTER );
             INIT_COUNTER( sout_send_bitrate, FLOAT, DERIVATIVE );
-            if( p_input->p->counters.p_sout_send_bitrate )
-                 p_input->p->counters.p_sout_send_bitrate->update_interval =
-                         1000000;
         }
     }
     else
diff --git a/src/libvlc.h b/src/libvlc.h
index 6a9aafc..0c551fe 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -241,7 +241,6 @@ typedef struct counter_t
     int                 i_samples;
     counter_sample_t ** pp_samples;
 
-    mtime_t             update_interval;
     mtime_t             last_update;
 } counter_t;
 
diff --git a/src/misc/stats.c b/src/misc/stats.c
index 60d77a2..a782668 100644
--- a/src/misc/stats.c
+++ b/src/misc/stats.c
@@ -63,7 +63,6 @@ counter_t * stats_CounterCreate( int i_type, int i_compute_type )
     p_counter->i_samples = 0;
     p_counter->pp_samples = NULL;
 
-    p_counter->update_interval = 0;
     p_counter->last_update = 0;
 
     return p_counter;
@@ -253,7 +252,7 @@ static int CounterUpdate( counter_t *p_counter,
     {
         counter_sample_t *p_new, *p_old;
         mtime_t now = mdate();
-        if( now - p_counter->last_update < p_counter->update_interval )
+        if( now - p_counter->last_update < CLOCK_FREQ )
         {
             return VLC_EGENERIC;
         }



More information about the vlc-commits mailing list