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

Steve Lhomme git at videolan.org
Fri Jan 29 14:54:18 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jan 21 06:57:57 2021 +0100| [8b1a6619d4c757036a2f48343f21433c0462980d] | committer: Steve Lhomme

video_output: tell when a display is actually late rather than when it might be

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8b1a6619d4c757036a2f48343f21433c0462980d
---

 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 93c3d50c75..eeb49e9ab6 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;



More information about the vlc-commits mailing list