From: RĂ©mi Duraffort Date: Thu, 12 Nov 2009 15:08:46 +0000 (+0100) Subject: rc: simplify and make one test usefull. X-Git-Tag: 1.1.0-ff~2492 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7dc473a399b6352f4133e1f4f87ffca0bfa8bacc;p=vlc rc: simplify and make one test usefull. --- diff --git a/modules/control/rc.c b/modules/control/rc.c index b42c0541d9..f59e9ce53e 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; }