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

playlist: use playlist_Play() directly, fix minor races

This function already checks if the playlist is running internally,
in which case it has no effects.
parent 612bcfc8
......@@ -208,14 +208,7 @@ DBUS_METHOD( Stop )
DBUS_METHOD( Play )
{
REPLY_INIT;
input_thread_t *p_input = pl_CurrentInput( p_this );
if( !p_input || var_GetInteger( p_input, "state" ) != PLAYING_S )
playlist_Play( PL );
if( p_input )
vlc_object_release( p_input );
playlist_Play( PL );
REPLY_SEND;
}
......
......@@ -1128,16 +1128,7 @@ void MainInputManager::togglePlayPause()
void MainInputManager::play()
{
/* No input, play */
if( !p_input )
playlist_Play( THEPL );
else
{
if( PLAYING_S != var_GetInteger( p_input, "state" ) )
{
playlist_TogglePause( THEPL );
}
}
playlist_Play( THEPL );
}
void MainInputManager::pause()
......
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