[vlc-devel] [PATCH v2 02/18] video_output: compute the date_refresh earlier in ThreadDisplayRenderPicture

Steve Lhomme robux4 at ycbcr.xyz
Wed Sep 16 13:14:28 CEST 2020


This will make the next patches easier to follow.

No functional changes.
---
 src/video_output/video_output.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index ad60942348a..c5e65d53d20 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1503,18 +1503,6 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     bool drop_next_frame = frame_by_frame;
     vlc_tick_t date_next = VLC_TICK_INVALID;
 
-    if (!paused && sys->displayed.next) {
-        const vlc_tick_t next_system_pts =
-            vlc_clock_ConvertToSystem(sys->clock, system_now,
-                                      sys->displayed.next->date, sys->rate);
-        if (likely(next_system_pts != INT64_MAX))
-        {
-            date_next = next_system_pts - render_delay;
-            if (date_next <= system_now)
-                drop_next_frame = true;
-        }
-    }
-
     /* FIXME/XXX we must redisplay the last decoded picture (because
      * of potential vout updated, or filters update or SPU update)
      * For now a high update period is needed but it could be removed
@@ -1531,6 +1519,19 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         date_refresh = sys->displayed.date + VOUT_REDISPLAY_DELAY - render_delay;
         refresh = date_refresh <= system_now;
     }
+
+    if (!paused && sys->displayed.next) {
+        const vlc_tick_t next_system_pts =
+            vlc_clock_ConvertToSystem(sys->clock, system_now,
+                                      sys->displayed.next->date, sys->rate);
+        if (likely(next_system_pts != INT64_MAX))
+        {
+            date_next = next_system_pts - render_delay;
+            if (date_next <= system_now)
+                drop_next_frame = true;
+        }
+    }
+
     bool force_refresh = !drop_next_frame && refresh;
 
     if (!frame_by_frame) {
-- 
2.26.2



More information about the vlc-devel mailing list