[vlc-devel] [PATCH] input_clock: set the final i_late version early

Thomas Guillem thomas at gllm.fr
Fri Aug 14 10:11:28 CEST 2020



On Thu, Aug 13, 2020, at 14:10, Steve Lhomme wrote:
> ---
>  src/clock/input_clock.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/clock/input_clock.c b/src/clock/input_clock.c
> index a143f02fc6f..b5472b33856 100644
> --- a/src/clock/input_clock.c
> +++ b/src/clock/input_clock.c
> @@ -270,7 +270,7 @@ vlc_tick_t input_clock_Update( input_clock_t *cl, 
> vlc_object_t *p_log,
>      /* It does not take the decoder latency into account but it is not 
> really
>       * the goal of the clock here */
>      const vlc_tick_t i_system_expected = ClockStreamToSystem( cl, 
> i_ck_stream + AvgGet( &cl->drift ) );
> -    const vlc_tick_t i_late = ( i_ck_system - cl->i_pts_delay ) - 
> i_system_expected;
> +    const vlc_tick_t i_late = __MAX(0, ( i_ck_system - cl->i_pts_delay 
> ) - i_system_expected);
>      if( i_late > 0 )

So, this test ^^ is always false?

>      {
>          cl->late.pi_value[cl->late.i_index] = i_late;
> @@ -279,7 +279,7 @@ vlc_tick_t input_clock_Update( input_clock_t *cl, 
> vlc_object_t *p_log,
>  
>      vlc_mutex_unlock( &cl->lock );
>  
> -    return i_late > 0 ? i_late : 0;
> +    return i_late;
>  }
>  
>  /*****************************************************************************
> -- 
> 2.26.2
> 
> _______________________________________________
> 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