[vlc-devel] [PATCH v2] video_output: tell when a display is actually late rather than when it might be

Steve Lhomme robux4 at ycbcr.xyz
Thu Jan 21 06:55:33 UTC 2021


Technically using vlc_clock_Wait() may also display the frame too late. 
It depends how much the wait resolution is accurate. For example on 
Windows it's not clear how much precise WaitOnAddress is. It might have 
a granularity of sevaral milliseconds. So we might be late by a few 
milliseconds even though we were originally ahead of time.

For now we don't log such late events.

On 2021-01-21 7:08, Steve Lhomme wrote:
> ---
>   src/video_output/video_output.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> index 93c3d50c75c..8401dc29fe3 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -1108,9 +1108,6 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
>                           picture_Release(decoded);
>                           vout_statistic_AddLost(&sys->statistic, 1);
>                           continue;
> -                    } else if (late > 0) {
> -                        msg_Dbg(&vout->obj, "picture might be displayed late (missing %"PRId64" ms)", MS_FROM_VLC_TICK(late));
> -                        vout_statistic_AddLate(&sys->statistic, 1);
>                       }
>                   }
>                   vlc_video_context *pic_vctx = picture_GetVideoContext(decoded);
> @@ -1416,7 +1413,12 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool render_now)
>       system_now = vlc_tick_now();
>       if (!render_now)
>       {
> -        if (unlikely(system_now > system_pts))
> +        const vlc_tick_t late = system_now - system_pts;
> +        if (late > 0) {
> +            msg_Dbg(vd, "picture displayed late (missing %"PRId64" ms)", MS_FROM_VLC_TICK(late));
> +            vout_statistic_AddLate(&sys->statistic, 1);
> +        }
> +        if (unlikely(late))
>           {
>               /* vd->prepare took too much time. Tell the clock that the pts was
>                * rendered late. */
> -- 
> 2.29.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