[vlc-devel] [PATCH 14/16] video_output: rename ambiguous refresh flag to redisplay_needed

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 16 16:26:45 CEST 2020


This flag really tells if the original displayed.current needs to be
re-displayed. It happens when the VOUT_REDISPLAY_DELAY threshold has passed.

The displayed.date keeps track of the date displayed.current was last
displayed.
---
 src/video_output/video_output.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 660cf7d5338..2c9c9252b79 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1543,21 +1543,22 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         *
         * So it will be done later.
         */
-        bool refresh = false;
+        bool redisplay_needed = 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;
+            redisplay_needed = date_refresh <= system_now;
         }
-        force_refresh = !dropped_current_frame && refresh;
+        force_refresh = !dropped_current_frame && redisplay_needed;
 
         if (date_refresh != VLC_TICK_INVALID)
             *deadline = date_refresh;
         if (date_next != VLC_TICK_INVALID && date_next < *deadline)
             *deadline = date_next;
 
-        if (!first && !refresh && !dropped_current_frame) {
+        if (!first && !redisplay_needed && !dropped_current_frame) {
+            // nothing changed, wait until the next deadline or a control
             return VLC_EGENERIC;
         }
     }
-- 
2.26.2



More information about the vlc-devel mailing list