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:
parent
c5cf779303
commit
a437fe543c
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user