/* status changes */
vlc_mutex_t status_lock;
playlist_status_t i_last_state;
- vlc_bool_t b_statistics;
#ifdef WIN32
HANDLE hConsoleIn;
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 );
}
}
- 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;
&val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string );
- if( val_name.psz_string ) free( val_name.psz_string );
+ free( val_name.psz_string );
i_error = VLC_SUCCESS;
}
if( p_item )
{
msg_rc( "Trying to add %s to playlist.", newval.psz_string );
- playlist_AddInput( p_playlist, p_item,
+ if( playlist_AddInput( p_playlist, p_item,
PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE,
- VLC_FALSE );
+ VLC_FALSE ) != VLC_SUCCESS );
+ {
+ return VLC_EGENERIC;
+ }
}
}
else if( !strcmp( psz_cmd, "enqueue" ) &&
if( p_item )
{
msg_rc( "trying to enqueue %s to playlist", newval.psz_string );
- playlist_AddInput( p_playlist, p_item,
+ if( playlist_AddInput( p_playlist, p_item,
PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE,
- VLC_FALSE);
+ VLC_FALSE ) != VLC_SUCCESS )
+ {
+ return VLC_EGENERIC;
+ }
}
}
else if( !strcmp( psz_cmd, "playlist" ) )
msg_rc( STATUS_CHANGE "( audio volume: %d )",
config_GetInt( p_intf, "volume" ));
- vlc_mutex_lock( &p_playlist->object_lock );
+ PL_LOCK;
switch( p_playlist->status.i_status )
{
case PLAYLIST_STOPPED:
msg_rc( STATUS_CHANGE "( state unknown )" );
break;
}
- vlc_mutex_unlock( &p_playlist->object_lock );
+ PL_UNLOCK;
}
}
&val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string );
- if( val_name.psz_string ) free( val_name.psz_string );
+ free( val_name.psz_string );
i_error = VLC_SUCCESS;
}
&val, &text );
msg_rc( "+----[ end of %s ]", val_name.psz_string );
- if( val_name.psz_string ) free( val_name.psz_string );
+ free( val_name.psz_string );
i_error = VLC_SUCCESS;
}
else
{
msg_rc( _("Please provide one of the following parameters:") );
msg_rc( "[on|off|up|down|left|right|select]" );
- if( val.psz_string ) free( val.psz_string );
- return i_error;
+ free( val.psz_string );
+ return i_error;
}
i_error = VLC_SUCCESS;
- if( val.psz_string ) free( val.psz_string );
+ free( val.psz_string );
return i_error;
}
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