[vlc-devel] [PATCH v2 17/18] video_output: move the display skipping return

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


That means handling the display_next_frame even if we're not going to display
anything. But if display_next_frame is true, we're not returning this error, so
the logic is unchanged.

And add some comments.
---
 src/video_output/video_output.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 95ade086b5b..0a63c64cc7c 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1544,10 +1544,6 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
 
     bool force_refresh = !display_next_frame && current_needs_redisplay;
 
-    if (!first && !current_needs_redisplay && !display_next_frame) {
-        return VLC_EGENERIC;
-    }
-
     if (display_next_frame) {
         picture_Release(sys->displayed.current);
         if (first)
@@ -1561,6 +1557,13 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         sys->displayed.next    = NULL;
     }
 
+    if (!first && !current_needs_redisplay && !display_next_frame) {
+        // Keep displaying the picture if there wasn't one before, the old one
+        // needs a redisplay, or we need to display the next frame.
+        // Otherwise return an error to wait until the next deadline.
+        return VLC_EGENERIC;
+    }
+
     /* display the picture immediately */
     bool immediate = frame_by_frame || force_refresh || sys->displayed.current->b_force;
     int ret = ThreadDisplayRenderPicture(vout, immediate);
-- 
2.26.2



More information about the vlc-devel mailing list