1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00

playlist: use playlist_TogglePause() directly, fix minor races

This function already starts playback if stopped (and as far as I know
it always has).
This commit is contained in:
Rémi Denis-Courmont 2014-12-15 19:21:58 +02:00
parent c5cf779303
commit a437fe543c
3 changed files with 3 additions and 18 deletions

View File

@ -229,16 +229,7 @@ DBUS_METHOD( Pause )
DBUS_METHOD( PlayPause )
{
REPLY_INIT;
input_thread_t *p_input = pl_CurrentInput( p_this );
if( p_input && var_GetInteger(p_input, "state") == PLAYING_S )
playlist_TogglePause( PL );
else
playlist_Play( PL );
if( p_input )
vlc_object_release( p_input );
playlist_TogglePause( PL );
REPLY_SEND;
}

View File

@ -349,10 +349,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
int state = var_GetInteger( p_input, "state" );
DisplayIcon( p_vout, state != PAUSE_S ? OSD_PAUSE_ICON : OSD_PLAY_ICON );
playlist_TogglePause( p_playlist );
}
else
playlist_Play( p_playlist );
playlist_TogglePause( p_playlist );
break;
case ACTIONID_PLAY:

View File

@ -1119,11 +1119,7 @@ void MainInputManager::prevOrReset()
void MainInputManager::togglePlayPause()
{
/* No input, play */
if( !p_input )
playlist_Play( THEPL );
else
playlist_TogglePause( THEPL );
playlist_TogglePause( THEPL );
}
void MainInputManager::play()