[vlc-devel] commit: rc: simplify and make one test usefull. ( Rémi Duraffort )

git version control git at videolan.org
Fri Nov 13 17:59:51 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Nov 12 16:08:46 2009 +0100| [7dc473a399b6352f4133e1f4f87ffca0bfa8bacc] | committer: Rémi Duraffort 

rc: simplify and make one test usefull.

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

 modules/control/rc.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index b42c054..f59e9ce 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -1865,7 +1865,7 @@ static int Menu( vlc_object_t *p_this, char const *psz_cmd,
 static int Statistics ( vlc_object_t *p_this, char const *psz_cmd,
     vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
-    VLC_UNUSED(oldval); VLC_UNUSED(newval); VLC_UNUSED(p_data);
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(newval); VLC_UNUSED(p_data);
     intf_thread_t *p_intf = (intf_thread_t*)p_this;
     input_thread_t *p_input =
         playlist_CurrentInput( p_intf->p_sys->p_playlist );
@@ -1873,20 +1873,7 @@ static int Statistics ( vlc_object_t *p_this, char const *psz_cmd,
     if( !p_input )
         return VLC_ENOOBJ;
 
-    if( !strcmp( psz_cmd, "stats" ) )
-    {
-        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
-     */
-    else
-    {
-        msg_rc("%s", _("Unknown command!") );
-    }
-
+    updateStatistics( p_intf, input_GetItem(p_input) );
     vlc_object_release( p_input );
     return VLC_SUCCESS;
 }
@@ -1895,6 +1882,7 @@ static int updateStatistics( intf_thread_t *p_intf, input_item_t *p_item )
 {
     if( !p_item ) return VLC_EGENERIC;
 
+    vlc_mutex_lock( &p_item->lock );
     vlc_mutex_lock( &p_item->p_stats->lock );
     msg_rc( "+----[ begin of statistical info ]" );
 
@@ -1937,6 +1925,7 @@ static int updateStatistics( intf_thread_t *p_intf, input_item_t *p_item )
     msg_rc("|");
     msg_rc( "+----[ end of statistical info ]" );
     vlc_mutex_unlock( &p_item->p_stats->lock );
+    vlc_mutex_unlock( &p_item->lock );
 
     return VLC_SUCCESS;
 }




More information about the vlc-devel mailing list