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

Steve Lhomme robux4 at ycbcr.xyz
Thu Jan 21 05:58:10 UTC 2021


---
 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..40918da86d9 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 be 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



More information about the vlc-devel mailing list