From: Jean-Paul Saman Date: Mon, 11 Feb 2008 15:45:53 +0000 (+0000) Subject: Simplify rc stats command X-Git-Tag: 0.9.0-test0~2696 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=2c5cd248e79197b1c2b181871946135f876c3bc9;p=vlc Simplify rc stats command --- diff --git a/modules/control/rc.c b/modules/control/rc.c index 409606de5a..94f70cb3cb 100644 --- a/modules/control/rc.c +++ b/modules/control/rc.c @@ -126,7 +126,6 @@ struct intf_sys_t /* status changes */ vlc_mutex_t status_lock; playlist_status_t i_last_state; - vlc_bool_t b_statistics; #ifdef WIN32 HANDLE hConsoleIn; @@ -324,7 +323,6 @@ static int Activate( vlc_object_t *p_this ) p_intf->p_sys->psz_unix_path = psz_unix_path; vlc_mutex_init( p_intf, &p_intf->p_sys->status_lock ); p_intf->p_sys->i_last_state = PLAYLIST_STOPPED; - p_intf->p_sys->b_statistics = VLC_FALSE; /* Non-buffered stdout */ setvbuf( stdout, (char *)NULL, _IOLBF, 0 ); @@ -583,13 +581,6 @@ static void Run( intf_thread_t *p_intf ) } } - if( p_input && p_intf->p_sys->b_statistics ) - { - vlc_mutex_lock( &input_GetItem(p_input)->lock ); - updateStatistics( p_intf, input_GetItem(p_input) ); - vlc_mutex_unlock( &input_GetItem(p_input)->lock ); - } - /* Is there something to do? */ if( !b_complete ) continue; @@ -1959,11 +1950,9 @@ static int Statistics ( vlc_object_t *p_this, char const *psz_cmd, if( !strcmp( psz_cmd, "stats" ) ) { - p_intf->p_sys->b_statistics = !p_intf->p_sys->b_statistics; - if( p_intf->p_sys->b_statistics ) - msg_rc(_("statistics update on")); - else - msg_rc(_("statistics update off")); + vlc_mutex_lock( &input_GetItem(p_input)->lock ); + updateStatistics( p_intf, input_GetItem(p_input) ); + vlc_mutex_unlock( &input_GetItem(p_input)->lock ); } /* * sanity check