From a09a26d4b7fa788f057b43f6022ba99bdee9b6ec Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 14 Sep 2021 09:29:21 +0200
Subject: [PATCH] video_output: rename confusing internal variables

The `next_system_pts` has nothing to do with the displayed.next picture. It's
the date of the displayed.current picture in system time.

The `date_next` also has nothing to do with the displayed.next picture. It's
the system date where we should initiate the prepare() for displayed.next.
---
 src/video_output/video_output.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0c9ee53cfac9..8164fc42ab9a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1474,13 +1474,13 @@ static int DisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     }
     else if (!paused)
     {
-        const vlc_tick_t next_system_pts =
+        const vlc_tick_t system_swap_current =
             vlc_clock_ConvertToSystem(sys->clock, system_now,
                                       sys->displayed.current->date, sys->rate);
-        if (likely(next_system_pts != VLC_TICK_MAX))
+        if (likely(system_swap_current != VLC_TICK_MAX))
         {
-            vlc_tick_t date_next = next_system_pts - render_delay;
-            if (date_next <= system_now)
+            vlc_tick_t system_prepare_current = system_swap_current - render_delay;
+            if (system_prepare_current <= system_now)
             {
                 // the current frame will be late, look for the next not late one
                 next = PreparePicture(vout, false, false);
-- 
GitLab