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

Steve Lhomme robux4 at ycbcr.xyz
Thu Aug 13 14:12:43 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 c5115ce3009..9c9045b6e67 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1855,7 +1855,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;
         }
@@ -1878,8 +1884,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