[vlc-devel] [PATCH] input: rework delay handling

Francois Cartegnie fcvlcdev at free.fr
Wed Jun 19 11:58:55 CEST 2019


Le 19/06/2019 à 11:40, Thomas Guillem a écrit :

> @@ -2755,20 +2777,20 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
>              if( b_late && ( !input_priv(p_sys->p_input)->p_sout ||
>                              !input_priv(p_sys->p_input)->b_out_pace_control ) )
>              {
> -                const vlc_tick_t i_pts_delay_base = p_sys->i_pts_delay - p_sys->i_pts_jitter;
>                  vlc_tick_t i_pts_delay = input_clock_GetJitter( p_pgrm->p_input_clock );
>  
>                  /* Avoid dangerously high value */
>                  const vlc_tick_t i_jitter_max =
>                          VLC_TICK_FROM_MS(var_InheritInteger( p_sys->p_input, "clock-jitter" ));
> -                if( i_pts_delay > __MIN( i_pts_delay_base + i_jitter_max, INPUT_PTS_DELAY_MAX ) )
> +                if( i_pts_delay > __MIN( p_sys->i_pts_delay + i_jitter_max, INPUT_PTS_DELAY_MAX ) )
>                  {
>                      es_out_pgrm_t *pgrm;
>  
>                      msg_Err( p_sys->p_input,
>                               "ES_OUT_SET_(GROUP_)PCR  is called too late (jitter of %d ms ignored)",
> -                             (int)MS_FROM_VLC_TICK(i_pts_delay - i_pts_delay_base) );
> -                    i_pts_delay = p_sys->i_pts_delay;
> +                             (int)MS_FROM_VLC_TICK(i_pts_delay - p_sys->i_pts_delay) );
> +                    i_pts_delay = p_sys->i_pts_delay + p_sys->i_pts_jitter
> +                                + p_sys->i_extra_pts_delay;
>

In my undertanding, this is breaking the jitter compensation

was
Current late delay mean > total delay - jitter + jitter_max
vs
Current late delay mean > total delay + jitter max + extra delay

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list