[vlc-devel] [PATCH 01/21] video_output: compute the date_refresh earlier in ThreadDisplayRenderPicture

Steve Lhomme robux4 at ycbcr.xyz
Tue Sep 15 14:36:06 CEST 2020


This will make the next patches easier to follow.

No functional changes.
---
 src/video_output/video_output.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index dc5e602002e..ef801f344b1 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1503,6 +1503,23 @@ 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;
 
+    /* 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
+     * if and only if:
+     * - vout module emits events from theselves.
+     * - *and* SPU is modified to emit an event or a deadline when needed.
+     *
+     * So it will be done later.
+     */
+    bool refresh = false;
+
+    vlc_tick_t date_refresh = VLC_TICK_INVALID;
+    if (sys->displayed.date != VLC_TICK_INVALID) {
+        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,
@@ -1520,22 +1537,6 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         }
     }
 
-    /* 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
-     * if and only if:
-     * - vout module emits events from theselves.
-     * - *and* SPU is modified to emit an event or a deadline when needed.
-     *
-     * So it will be done later.
-     */
-    bool refresh = false;
-
-    vlc_tick_t date_refresh = VLC_TICK_INVALID;
-    if (sys->displayed.date != VLC_TICK_INVALID) {
-        date_refresh = sys->displayed.date + VOUT_REDISPLAY_DELAY - render_delay;
-        refresh = date_refresh <= system_now;
-    }
     bool force_refresh = !drop_next_frame && refresh;
 
     if (!frame_by_frame) {
-- 
2.26.2



More information about the vlc-devel mailing list