[vlc-devel] [PATCH 2/3] video_output: only use the next picture in frame by frame if there is one

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 17 14:22:16 CET 2020


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

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index aee67e17f2e..166641e42f0 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1487,16 +1487,15 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     bool render_now;
     if (frame_by_frame)
     {
-        if (!sys->displayed.next)
+        picture_t *next =
+            ThreadDisplayPreparePicture(vout, false, true, &paused);
+
+        if (next != NULL)
         {
-            sys->displayed.next =
-                ThreadDisplayPreparePicture(vout, false, true, &paused);
+            picture_Release(sys->displayed.current);
+            sys->displayed.current = next;
         }
 
-        picture_Release(sys->displayed.current);
-        sys->displayed.current = sys->displayed.next;
-        sys->displayed.next    = NULL;
-
         render_now = true;
     }
     else
-- 
2.26.2



More information about the vlc-devel mailing list