[vlc-devel] [PATCH v2 12/18] video_output: render the picture immediately if filters changed

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


It doesn't matter if we are displaying a new picture or an old picture. If the
user changed the filter it should be displayed ASAP.

It is less true when only the source deinterlacing changes, it's not a user
interaction and can keep the timing unchanged.

We must not force a redisplay (immediate) if this is the first frame, as its
display date may be far in the future.
---
 src/video_output/video_output.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 26e64715aeb..add2c90df36 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1473,6 +1473,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     bool frame_by_frame = !deadline;
     bool paused = sys->pause.is_on;
     const bool first = !sys->displayed.current;
+    bool filters_changed = false;
 
     assert(sys->clock);
 
@@ -1482,6 +1483,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     {
         sys->private.interlacing.has_deint = sys->filter.new_interlaced;
         ThreadChangeFilters(vout);
+        filters_changed = sys->filter.changed;
     }
     vlc_mutex_unlock(&sys->filter.lock);
 
@@ -1514,11 +1516,11 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
      *
      * So it will be done later.
      */
-    bool current_needs_redisplay = false;
+    bool current_needs_redisplay = filters_changed && !first;
 
     if (sys->displayed.date != VLC_TICK_INVALID) {
         const vlc_tick_t date_refresh = sys->displayed.date + VOUT_REDISPLAY_DELAY - render_delay;
-        current_needs_redisplay = date_refresh <= system_now; // we passed the redisplay date
+        current_needs_redisplay |= date_refresh <= system_now; // we passed the redisplay date
         if (deadline != NULL)
             *deadline = date_refresh;
     }
-- 
2.26.2



More information about the vlc-devel mailing list