[vlc-devel] [PATCH v2 6/7] player: add gapless support

Thomas Guillem thomas at gllm.fr
Wed Mar 20 18:09:13 CET 2019


Notify the aout when there is a next media to play.
---
 src/input/player.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/input/player.c b/src/input/player.c
index 6cb2b334aa..c26d24b756 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -707,6 +707,17 @@ vlc_player_input_Start(struct vlc_player_input *input)
     return ret;
 }
 
+static void
+vlc_player_SetGaplessEnabled(vlc_player_t *player, bool enabled)
+{
+    audio_output_t *aout = input_resource_HoldAout(player->resource);
+    if (aout)
+    {
+        aout_OutputSetGaplessEnabled(aout, enabled);
+        aout_Release(aout);
+    }
+}
+
 static void
 vlc_player_PrepareNextMedia(vlc_player_t *player)
 {
@@ -721,6 +732,7 @@ vlc_player_PrepareNextMedia(vlc_player_t *player)
     player->next_media =
         player->media_provider->get_next(player, player->media_provider_data);
     player->next_media_requested = true;
+    vlc_player_SetGaplessEnabled(player, player->next_media != NULL);
 }
 
 static int
@@ -3469,6 +3481,7 @@ vlc_player_Delete(vlc_player_t *player)
 
     vlc_player_DestroyLocks(player);
 
+    vlc_player_SetGaplessEnabled(player, false);
     audio_output_t *aout = vlc_player_aout_Hold(player);
     if (aout)
     {
-- 
2.20.1



More information about the vlc-devel mailing list