#ifndef WIN32
#if defined(HAVE_ISATTY)
/* Check that stdin is a TTY */
- if( !var_InheritInteger( p_intf, "rc-fake-tty" ) && !isatty( 0 ) )
+ if( !var_InheritBool( p_intf, "rc-fake-tty" ) && !isatty( 0 ) )
{
msg_Warn( p_intf, "fd 0 is not a TTY" );
return VLC_EGENERIC;
p_intf->pf_run = Run;
#ifdef WIN32
- p_intf->p_sys->b_quiet = var_InheritInteger( p_intf, "rc-quiet" );
+ p_intf->p_sys->b_quiet = var_InheritBool( p_intf, "rc-quiet" );
if( !p_intf->p_sys->b_quiet ) { CONSOLE_INTRO_MSG; }
#else
CONSOLE_INTRO_MSG;
playlist_t * p_playlist = pl_Get( p_intf );
char p_buffer[ MAX_LINE_LENGTH + 1 ];
- bool b_showpos = var_InheritInteger( p_intf, "rc-show-pos" );
+ bool b_showpos = var_InheritBool( p_intf, "rc-show-pos" );
bool b_longhelp = false;
int i_size = 0;
/* status callbacks */
/* Listen to audio volume updates */
- var_AddCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, p_intf );
+ var_AddCallback( p_playlist, "volume-change", VolumeChanged, p_intf );
#ifdef WIN32
/* Get the file descriptor of the console input */
if( p_playlist )
{
- PL_LOCK;
p_intf->p_sys->i_last_state = (int) PLAYLIST_STOPPED;
msg_rc( STATUS_CHANGE "( stop state: 0 )" );
- PL_UNLOCK;
}
}
{
PL_LOCK;
int status = playlist_Status( p_playlist );
+ PL_UNLOCK;
+
if( p_intf->p_sys->i_last_state != status )
{
if( status == PLAYLIST_STOPPED )
msg_rc( STATUS_CHANGE "( pause state: 4 )" );
}
}
- PL_UNLOCK;
}
if( p_input && b_showpos )
vlc_object_release( p_input );
}
- var_DelCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, p_intf );
+ var_DelCallback( p_playlist, "volume-change", VolumeChanged, p_intf );
vlc_restorecancel( canc );
}
for ( i = 0; i < val.p_list->i_count; i++ )
{
if ( i_value == val.p_list->p_values[i].i_int )
- msg_rc( "| %i - %s *", val.p_list->p_values[i].i_int,
+ msg_rc( "| %"PRId64" - %s *",
+ val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string );
else
- msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
+ msg_rc( "| %"PRId64" - %s",
+ val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string );
}
var_FreeList( &val, &text );
}
else if (!strcmp( psz_cmd, "goto" ) )
{
+ PL_LOCK;
int i_pos = atoi( newval.psz_string );
/* The playlist stores 2 times the same item: onelevel & category */
int i_size = p_playlist->items.i_size / 2;
p_item = p_parent = p_playlist->items.p_elems[i_pos*2-1];
while( p_parent->p_parent )
p_parent = p_parent->p_parent;
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Unlocked,
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked,
p_parent, p_item );
}
else
msg_rc( _("Playlist has only %d elements"), i_size );
+ PL_UNLOCK;
}
else if( !strcmp( psz_cmd, "stop" ) )
{
else if( !strcmp( psz_cmd, "sort" ))
{
+ PL_LOCK;
playlist_RecursiveNodeSort( p_playlist, p_playlist->p_root_onelevel,
SORT_ARTIST, ORDER_NORMAL );
+ PL_UNLOCK;
}
else if( !strcmp( psz_cmd, "status" ) )
{
config_GetInt( p_intf, "volume" ));
PL_LOCK;
- switch( playlist_Status(p_playlist) )
+ int status = playlist_Status(p_playlist);
+ PL_UNLOCK;
+ switch( status )
{
case PLAYLIST_STOPPED:
msg_rc( STATUS_CHANGE "( stop state: 5 )" );
msg_rc( STATUS_CHANGE "( unknown state: -1 )" );
break;
}
- PL_UNLOCK;
vlc_object_release( p_input );
}
}
for ( i = 0; i < val.p_list->i_count; i++ )
{
if ( i_value == val.p_list->p_values[i].i_int )
- msg_rc( "| %i - %s *", val.p_list->p_values[i].i_int,
+ msg_rc( "| %"PRId64" - %s *", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string );
else
- msg_rc( "| %i - %s", val.p_list->p_values[i].i_int,
+ msg_rc( "| %"PRId64" - %s", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string );
}
var_FreeList( &val, &text );
/* Input */
msg_rc("%s", _("+-[Incoming]"));
- msg_rc(_("| input bytes read : %8.0f kB"),
- (float)(p_item->p_stats->i_read_bytes)/1000 );
+ msg_rc(_("| input bytes read : %8.0f KiB"),
+ (float)(p_item->p_stats->i_read_bytes)/1024 );
msg_rc(_("| input bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_input_bitrate)*8000 );
- msg_rc(_("| demux bytes read : %8.0f kB"),
- (float)(p_item->p_stats->i_demux_read_bytes)/1000 );
+ msg_rc(_("| demux bytes read : %8.0f KiB"),
+ (float)(p_item->p_stats->i_demux_read_bytes)/1024 );
msg_rc(_("| demux bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_demux_bitrate)*8000 );
msg_rc(_("| demux corrupted : %5i"),
/* Sout */
msg_rc("%s", _("+-[Streaming]"));
msg_rc(_("| packets sent : %5i"), p_item->p_stats->i_sent_packets );
- msg_rc(_("| bytes sent : %8.0f kB"),
- (float)(p_item->p_stats->i_sent_bytes)/1000 );
+ msg_rc(_("| bytes sent : %8.0f KiB"),
+ (float)(p_item->p_stats->i_sent_bytes)/1024 );
msg_rc(_("| sending bitrate : %6.0f kb/s"),
(float)(p_item->p_stats->f_send_bitrate*8)*1000 );
msg_rc("|");