[vlc-devel] [PATCH 04/17] video_output: keep the displayed.current in frame by frame if next is not ready

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 20 15:44:54 CET 2020


And no need to reuse displayed.next which is always NULL otherwise.
---
 src/video_output/video_output.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 2ecb4d8161d..35f13609c02 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1487,16 +1487,14 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     bool render_now;
     if (frame_by_frame)
     {
-        if (!sys->displayed.next)
-        {
-            sys->displayed.next =
-                ThreadDisplayPreparePicture(vout, false, true, &paused);
-        }
+        picture_t *next;
+        next = ThreadDisplayPreparePicture(vout, false, true, &paused);
+        if (next == NULL)
+            return VLC_EGENERIC;
 
         if (likely(sys->displayed.current != NULL))
             picture_Release(sys->displayed.current);
-        sys->displayed.current = sys->displayed.next;
-        sys->displayed.next    = NULL;
+        sys->displayed.current = next;
 
         render_now = true;
     }
-- 
2.26.2



More information about the vlc-devel mailing list