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

Thomas Guillem thomas at gllm.fr
Thu Mar 21 09:37:06 CET 2019


The big issue with this patch is that the aout stream will be kept open if the next media doesn't have any audio.

I'll think of something else, but I don't think this will have an impact on the "aout: add gapless support" patch.

On Wed, Mar 20, 2019, at 18:09, Thomas Guillem wrote:
> 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
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list