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 ) ...@@ -229,16 +229,7 @@ DBUS_METHOD( Pause )
DBUS_METHOD( PlayPause ) DBUS_METHOD( PlayPause )
{ {
REPLY_INIT; REPLY_INIT;
input_thread_t *p_input = pl_CurrentInput( p_this );
if( p_input && var_GetInteger(p_input, "state") == PLAYING_S )
playlist_TogglePause( PL ); playlist_TogglePause( PL );
else
playlist_Play( PL );
if( p_input )
vlc_object_release( p_input );
REPLY_SEND; REPLY_SEND;
} }
......
...@@ -349,10 +349,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -349,10 +349,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
int state = var_GetInteger( p_input, "state" ); int state = var_GetInteger( p_input, "state" );
DisplayIcon( p_vout, state != PAUSE_S ? OSD_PAUSE_ICON : OSD_PLAY_ICON ); DisplayIcon( p_vout, state != PAUSE_S ? OSD_PAUSE_ICON : OSD_PLAY_ICON );
playlist_TogglePause( p_playlist );
} }
else playlist_TogglePause( p_playlist );
playlist_Play( p_playlist );
break; break;
case ACTIONID_PLAY: case ACTIONID_PLAY:
......
...@@ -1119,10 +1119,6 @@ void MainInputManager::prevOrReset() ...@@ -1119,10 +1119,6 @@ void MainInputManager::prevOrReset()
void MainInputManager::togglePlayPause() void MainInputManager::togglePlayPause()
{ {
/* No input, play */
if( !p_input )
playlist_Play( THEPL );
else
playlist_TogglePause( THEPL ); playlist_TogglePause( THEPL );
} }
......
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