Commit 9ea2d78d authored by Laurent Aimar's avatar Laurent Aimar

Reduced a bit intf and statistics updates.

Interfaces are updated every 250 millisecond.
Statistiques are updated every second.
parent 20821641
...@@ -718,8 +718,8 @@ static void MainLoopStatistic( input_thread_t *p_input ) ...@@ -718,8 +718,8 @@ static void MainLoopStatistic( input_thread_t *p_input )
static void MainLoop( input_thread_t *p_input ) static void MainLoop( input_thread_t *p_input )
{ {
mtime_t i_start_mdate = mdate(); mtime_t i_start_mdate = mdate();
int64_t i_intf_update = 0; mtime_t i_intf_update = 0;
int i_updates = 0; mtime_t i_statistic_update = 0;
/* Start the timer */ /* Start the timer */
stats_TimerStop( p_input, STATS_TIMER_INPUT_LAUNCHING ); stats_TimerStop( p_input, STATS_TIMER_INPUT_LAUNCHING );
...@@ -729,6 +729,7 @@ static void MainLoop( input_thread_t *p_input ) ...@@ -729,6 +729,7 @@ static void MainLoop( input_thread_t *p_input )
bool b_force_update; bool b_force_update;
int i_type; int i_type;
vlc_value_t val; vlc_value_t val;
mtime_t i_current;
/* Do the read */ /* Do the read */
if( p_input->i_state != PAUSE_S ) if( p_input->i_state != PAUSE_S )
...@@ -753,15 +754,18 @@ static void MainLoop( input_thread_t *p_input ) ...@@ -753,15 +754,18 @@ static void MainLoop( input_thread_t *p_input )
} }
vlc_mutex_unlock( &p_input->p->lock_control ); vlc_mutex_unlock( &p_input->p->lock_control );
if( b_force_update || i_intf_update < mdate() ) /* Update interface and statistics */
i_current = mdate();
if( i_intf_update < i_current || b_force_update )
{ {
MainLoopInterface( p_input ); MainLoopInterface( p_input );
i_intf_update = mdate() + INT64_C(150000); i_intf_update = i_current + INT64_C(250000);
} }
if( i_statistic_update < i_current )
/* 150ms * 8 = ~ 1 second */ {
if( ++i_updates % 8 == 0 )
MainLoopStatistic( p_input ); MainLoopStatistic( p_input );
i_statistic_update = i_current + INT64_C(1000000);
}
} }
if( !p_input->b_eof && !p_input->b_error && p_input->p->input.b_eof ) if( !p_input->b_eof && !p_input->b_error && p_input->p->input.b_eof )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment