[vlc-devel] [PATCH 11/21] video_output: rework the first frame prepare

Steve Lhomme robux4 at ycbcr.xyz
Tue Sep 15 14:36:16 CEST 2020


The goal of this piece of code is to make sure we use
ThreadDisplayPreparePicture with a displayed.current. It doesn't matter if it's
the first or not. It won't be the first after a flush, for example. We don't
need a temporary variable which is more confusing.

We cannot reach the rest of the code with "first" set to false (ie, no
displayed.current), so we can remove the test.
---
 src/video_output/video_output.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index da661e2e787..edf4512b734 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1488,9 +1488,12 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     if (deadline)
         *deadline = INVALID_DEADLINE;
 
-    if (first)
-        if (ThreadDisplayPreparePicture(vout, true, frame_by_frame, &paused)) /* FIXME not sure it is ok */
+    if (!sys->displayed.current)
+    {
+        ThreadDisplayPreparePicture(vout, true, frame_by_frame, &paused);
+        if (sys->displayed.current == NULL)
             return VLC_EGENERIC;
+    }
 
     if (!paused || frame_by_frame)
         while (!sys->displayed.next
@@ -1541,7 +1544,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         }
     }
 
-    if (!first && !current_needs_redisplay && !display_next_frame) {
+    if (!current_needs_redisplay && !display_next_frame) {
         return VLC_EGENERIC;
     }
 
-- 
2.26.2



More information about the vlc-devel mailing list