[vlc-devel] [PATCH] player: fixed input position and time when paused

Thomas Guillem thomas at gllm.fr
Thu Feb 20 09:59:54 CET 2020


Hello,

On Wed, Feb 19, 2020, at 18:21, quentin.chateau at deepskycorp.com wrote:
> From: Quentin Chateau <quentin.chateau at deepskycorp.com>
> 
> This commit reverts part of the changes made in commit
> 9733154628772eddcd8d4a544ca75f613c02512a
> 
> When the player is paused, vlc_player_input_GetPos and
> vlc_player_input_GetTime would return invalid values

If you revert it, then time and pos are now 500ms to 2sec late (depending on the OS) like before.
The correct fix belongs to src/player/timer.c or src/clock/clock.c

> ---
>  src/player/input.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/src/player/input.c b/src/player/input.c
> index 37a235664b..1a57ca6852 100644
> --- a/src/player/input.c
> +++ b/src/player/input.c
> @@ -60,24 +60,12 @@ vlc_player_input_HandleAtoBLoop(struct 
> vlc_player_input *input, vlc_tick_t time,
>  vlc_tick_t
>  vlc_player_input_GetTime(struct vlc_player_input *input)
>  {
> -    vlc_player_t *player = input->player;
> -    vlc_tick_t ts;
> -
> -    if (input == player->input
> -     && vlc_player_GetTimerPoint(player, vlc_tick_now(), &ts, NULL) == 
> 0)
> -        return ts;
>      return input->time;
>  }
>  
>  float
>  vlc_player_input_GetPos(struct vlc_player_input *input)
>  {
> -    vlc_player_t *player = input->player;
> -    float pos;
> -
> -    if (input == player->input
> -     && vlc_player_GetTimerPoint(player, vlc_tick_now(), NULL, &pos) == 0)
> -        return pos;
>      return input->position;
>  }
>  
> -- 
> 2.17.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