[vlc-devel] [PATCH 16/17] video_output: use the rendering delay when we were given a deadline to wait for

Steve Lhomme robux4 at ycbcr.xyz
Mon Sep 14 16:03:27 CEST 2020


Otherwise we don't need to estimate the needed control deadline. We either
don't wait or use a hardcoded deadline of 100 ms before we try to render again.
---
 src/video_output/video_output.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index a1aa5122027..29c91bc7bb9 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1885,7 +1885,13 @@ static void *Thread(void *object)
         if (wait)
         {
             const vlc_tick_t max_deadline = vlc_tick_now() + VLC_TICK_FROM_MS(100);
-            deadline = deadline == VLC_TICK_INVALID ? max_deadline : __MIN(deadline, max_deadline);
+            if (deadline == VLC_TICK_INVALID)
+                deadline = max_deadline;
+            else
+            {
+                deadline -= vout_chrono_GetHigh(&sys->render) + VOUT_MWAIT_TOLERANCE;
+                deadline = __MIN(deadline, max_deadline);
+            }
         } else {
             deadline = VLC_TICK_INVALID;
         }
@@ -1901,8 +1907,6 @@ static void *Thread(void *object)
         }
 
         wait = ThreadDisplayPicture(vout, &deadline) != VLC_SUCCESS;
-        if (deadline != VLC_TICK_INVALID)
-            deadline -= vout_chrono_GetHigh(&sys->render) + VOUT_MWAIT_TOLERANCE;
 
         const bool picture_interlaced = sys->displayed.is_interlaced;
 
-- 
2.26.2



More information about the vlc-devel mailing list