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

Steve Lhomme robux4 at ycbcr.xyz
Fri Aug 21 11:59:31 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 f3f7bd7e334..a3e9844d22f 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1838,7 +1838,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;
         }
@@ -1854,8 +1860,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