]> git.sesse.net Git - vlc/commitdiff
Simplify rc stats command
authorJean-Paul Saman <jpsaman@videolan.org>
Mon, 11 Feb 2008 15:45:53 +0000 (15:45 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Mon, 11 Feb 2008 15:45:53 +0000 (15:45 +0000)
modules/control/rc.c

index 409606de5a9edf3a0abdbf9cf6d5c439e0e4119b..94f70cb3cbf31664210ca25ad4f3597158821fef 100644 (file)
@@ -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