Commit 7dc473a3 authored by Rémi Duraffort's avatar Rémi Duraffort

rc: simplify and make one test usefull.

parent 837bf32e
......@@ -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;
}
......
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