X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcontrol%2Frc.c;h=fe10a0c0405666c27a4641244e96aa962ef4c4b7;hb=496194df14b925c49931c39167c8c09f4c1a113b;hp=c8c93c55725244e6cc833d975996ec5966768187;hpb=972e458c4744e95e67f57b73758db9197b3f5582;p=vlc diff --git a/modules/control/rc.c b/modules/control/rc.c index c8c93c5572..fe10a0c040 100644 --- a/modules/control/rc.c +++ b/modules/control/rc.c @@ -499,7 +499,7 @@ static void Run( intf_thread_t *p_intf ) msg_rc( STATUS_CHANGE "( new input: %s )", psz_uri ); free( psz_uri ); msg_rc( STATUS_CHANGE "( audio volume: %d )", - config_GetInt( p_intf, "volume" )); + (int)config_GetInt( p_intf, "volume" )); } var_AddCallback( p_input, "intf-event", InputEvent, p_intf ); } @@ -512,10 +512,8 @@ static void Run( intf_thread_t *p_intf ) if( p_playlist ) { - PL_LOCK; p_intf->p_sys->i_last_state = (int) PLAYLIST_STOPPED; msg_rc( STATUS_CHANGE "( stop state: 0 )" ); - PL_UNLOCK; } } @@ -524,6 +522,8 @@ static void Run( intf_thread_t *p_intf ) { PL_LOCK; int status = playlist_Status( p_playlist ); + PL_UNLOCK; + if( p_intf->p_sys->i_last_state != status ) { if( status == PLAYLIST_STOPPED ) @@ -542,7 +542,6 @@ static void Run( intf_thread_t *p_intf ) msg_rc( STATUS_CHANGE "( pause state: 4 )" ); } } - PL_UNLOCK; } if( p_input && b_showpos ) @@ -901,7 +900,7 @@ static int VolumeChanged( vlc_object_t *p_this, char const *psz_cmd, vlc_mutex_lock( &p_intf->p_sys->status_lock ); msg_rc( STATUS_CHANGE "( audio volume: %d )", - config_GetInt( p_this, "volume") ); + (int)config_GetInt( p_this, "volume") ); vlc_mutex_unlock( &p_intf->p_sys->status_lock ); return VLC_SUCCESS; } @@ -1185,10 +1184,12 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, 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 ); @@ -1325,6 +1326,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, } 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; @@ -1337,11 +1339,12 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, 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" ) ) { @@ -1395,8 +1398,10 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, 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" ) ) { @@ -1409,10 +1414,12 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, msg_rc( STATUS_CHANGE "( new input: %s )", psz_uri ); free( psz_uri ); msg_rc( STATUS_CHANGE "( audio volume: %d )", - config_GetInt( p_intf, "volume" )); + (int)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 )" ); @@ -1427,7 +1434,6 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, msg_rc( STATUS_CHANGE "( unknown state: -1 )" ); break; } - PL_UNLOCK; vlc_object_release( p_input ); } } @@ -1757,10 +1763,10 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd, 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 );