Skip to content
Snippets Groups Projects
Commit 5c1387c3 authored by Thomas Guillem's avatar Thomas Guillem Committed by Rémi Denis-Courmont
Browse files

lib: media_list: use the Stopped event

EndReached is sent when the player is stopping, so listen to the stopped
event instead.
parent 6d3b8ada
No related branches found
No related tags found
Loading
......@@ -400,7 +400,7 @@ uninstall_playlist_observer(libvlc_media_list_player_t * p_mlp)
static void
install_media_player_observer(libvlc_media_list_player_t * p_mlp)
{
libvlc_event_attach(mplayer_em(p_mlp), libvlc_MediaPlayerEndReached, media_player_reached_end, p_mlp);
libvlc_event_attach(mplayer_em(p_mlp), libvlc_MediaPlayerStopped, media_player_reached_end, p_mlp);
}
......@@ -415,7 +415,7 @@ uninstall_media_player_observer(libvlc_media_list_player_t * p_mlp)
// Allow callbacks to run, because detach() will wait until all callbacks are processed.
// This is safe because only callbacks are allowed, and there execution will be cancelled.
vlc_mutex_unlock(&p_mlp->mp_callback_lock);
libvlc_event_detach(mplayer_em(p_mlp), libvlc_MediaPlayerEndReached, media_player_reached_end, p_mlp);
libvlc_event_detach(mplayer_em(p_mlp), libvlc_MediaPlayerStopped, media_player_reached_end, p_mlp);
// Now, lock back the callback lock. No more callback will be present from this point.
vlc_mutex_lock(&p_mlp->mp_callback_lock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment