[vlc-devel] [PATCH 1/4] video_output: don't use displayed.next in frame by frame mode

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 10 13:27:45 CET 2020


We don't need to set the variable temporarily to reset it a few lines later.
---
 src/video_output/video_output.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index e43d537781c..62c9e854fce 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1487,16 +1487,16 @@ 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 =
+        picture_Release(sys->displayed.current);
+        if (likely(sys->displayed.next == NULL))
+            sys->displayed.current =
                 ThreadDisplayPreparePicture(vout, false, true, &paused);
+        else
+        {
+            sys->displayed.current = sys->displayed.next;
+            sys->displayed.next = NULL;
         }
 
-        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