Commit fe0668c8 authored by Zhao Zhili's avatar Zhao Zhili Committed by Thomas Guillem

libvlc: don't check current state in libvlc_media_player_set_pause

Since input_Control is executed asynchronously, current state may be
different to the state when INPUT_SET_STATE executing. Here is a use
case which is broken by check current state in

1. current state is paused
2. call libvlc_media_player_play()
3. call libvlc_media_player_set_pause() immediately before
INPUT_SET_STATE PLAYING_S is executed, libvlc_media_player_set_pause()
will do nothing, so it looks like the pause request is been dropped
Signed-off-by: Thomas Guillem's avatarThomas Guillem <>
parent b1ea27b2
......@@ -1007,9 +1007,6 @@ void libvlc_media_player_set_pause( libvlc_media_player_t *p_mi, int paused )
if( !p_input_thread )
libvlc_state_t state = libvlc_media_player_get_state( p_mi );
if( state == libvlc_Playing )
if( paused )
if( libvlc_media_player_can_pause( p_mi ) )
......@@ -1017,10 +1014,8 @@ void libvlc_media_player_set_pause( libvlc_media_player_t *p_mi, int paused )
input_Stop( p_input_thread );
if( !paused )
input_Control( p_input_thread, INPUT_SET_STATE, PLAYING_S );
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