Commit a437fe54 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

playlist: use playlist_TogglePause() directly, fix minor races

This function already starts playback if stopped (and as far as I know
it always has).
parent c5cf7793
......@@ -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;
}
......
......@@ -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:
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment