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

libvlc: fix small race

parent 65ebc4b5
...@@ -933,14 +933,12 @@ int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi ) ...@@ -933,14 +933,12 @@ int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi )
**************************************************************************/ **************************************************************************/
void libvlc_media_player_stop( libvlc_media_player_t *p_mi ) void libvlc_media_player_stop( libvlc_media_player_t *p_mi )
{ {
libvlc_state_t state = libvlc_media_player_get_state( p_mi );
lock_input(p_mi); lock_input(p_mi);
release_input_thread( p_mi ); /* This will stop the input thread */ release_input_thread( p_mi ); /* This will stop the input thread */
/* Force to go to stopped state, in case we were in Ended, or Error /* Force to go to stopped state, in case we were in Ended, or Error
* state. */ * state. */
if( state != libvlc_Stopped ) if( p_mi->state != libvlc_Stopped )
{ {
set_state( p_mi, libvlc_Stopped, false ); set_state( p_mi, libvlc_Stopped, false );
......
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