[vlc-devel] [PATCH 3.x 2/2] WIP: lib: media_list_player: change media asynchronously

Thomas Guillem thomas at gllm.fr
Mon Oct 19 16:07:37 CEST 2020


Maybe, this change is too big for VLC 3.0.
We could also add a new media_list constructor:
libvlc_media_list_player_new_async() that will call async functions of the
media_player. That way, the old (and blocking) behavior is kept.
---
 lib/media_list_player.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/media_list_player.c b/lib/media_list_player.c
index 7f4d427f63..1e98661280 100644
--- a/lib/media_list_player.c
+++ b/lib/media_list_player.c
@@ -459,7 +459,7 @@ set_current_playing_item(libvlc_media_list_player_t * p_mlp, libvlc_media_list_p
     /* Make sure media_player_reached_end() won't get called */
     uninstall_media_player_observer(p_mlp);
 
-    libvlc_media_player_set_media(p_mlp->p_mi, p_md);
+    libvlc_media_player_set_media_async(p_mlp->p_mi, p_md);
 
     install_media_player_observer(p_mlp);
     libvlc_media_release(p_md); /* for libvlc_media_list_item_at_index */
@@ -738,7 +738,7 @@ static void stop(libvlc_media_list_player_t * p_mlp)
 
     /* We are not interested in getting media stop event now */
     uninstall_media_player_observer(p_mlp);
-    libvlc_media_player_stop(p_mlp->p_mi);
+    libvlc_media_player_stop_async(p_mlp->p_mi);
     install_media_player_observer(p_mlp);
 
     free(p_mlp->current_playing_item_path);
-- 
2.28.0



More information about the vlc-devel mailing list