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 ) ...@@ -208,14 +208,7 @@ DBUS_METHOD( Stop )
DBUS_METHOD( Play ) DBUS_METHOD( Play )
{ {
REPLY_INIT; REPLY_INIT;
input_thread_t *p_input = pl_CurrentInput( p_this ); playlist_Play( PL );
if( !p_input || var_GetInteger( p_input, "state" ) != PLAYING_S )
playlist_Play( PL );
if( p_input )
vlc_object_release( p_input );
REPLY_SEND; REPLY_SEND;
} }
......
...@@ -1128,16 +1128,7 @@ void MainInputManager::togglePlayPause() ...@@ -1128,16 +1128,7 @@ void MainInputManager::togglePlayPause()
void MainInputManager::play() void MainInputManager::play()
{ {
/* No input, play */ playlist_Play( THEPL );
if( !p_input )
playlist_Play( THEPL );
else
{
if( PLAYING_S != var_GetInteger( p_input, "state" ) )
{
playlist_TogglePause( THEPL );
}
}
} }
void MainInputManager::pause() 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