[vlc-devel] [PATCH] player: fix only one media played with --play-and-exit

Thomas Guillem thomas at gllm.fr
Mon Nov 25 17:34:06 CET 2019


---
 src/player/player.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/player/player.c b/src/player/player.c
index d624f7e3456..4fe9a408132 100644
--- a/src/player/player.c
+++ b/src/player/player.c
@@ -54,9 +54,11 @@ vlc_player_PrepareNextMedia(vlc_player_t *player)
 {
     vlc_player_assert_locked(player);
 
-    if (!player->media_provider
-     || player->media_stopped_action != VLC_PLAYER_MEDIA_STOPPED_CONTINUE
-     || player->next_media_requested)
+    /* STOPPED_CONTINUE is the normal behavior. STOPPED_EXIT mean exit when all
+     * medias are played, so we need to request a next media if any. */
+    if (!player->media_provider || player->next_media_requested
+     || (player->media_stopped_action != VLC_PLAYER_MEDIA_STOPPED_CONTINUE
+      && player->media_stopped_action != VLC_PLAYER_MEDIA_STOPPED_EXIT))
         return;
 
     assert(player->next_media == NULL);
-- 
2.20.1



More information about the vlc-devel mailing list