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 );
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;
}
{
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 ]" );
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;
}