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

Steve Lhomme robux4 at ycbcr.xyz
Thu Jan 21 12:08:17 UTC 2021


---
 src/video_output/video_output.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 93c3d50c75c..eeb49e9ab62 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,8 +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 (unlikely(late > 0)) 
         {
+            msg_Dbg(vd, "picture displayed late (missing %"PRId64" ms)", MS_FROM_VLC_TICK(late));
+            vout_statistic_AddLate(&sys->statistic, 1);
+
             /* vd->prepare took too much time. Tell the clock that the pts was
              * rendered late. */
             system_pts = system_now;
-- 
2.29.2



More information about the vlc-devel mailing list