[vlc-devel] [PATCH v2 15/18] video_output: only set displayed.next on the second ThreadDisplayPreparePicture call

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


This code can only be reached if displayed.current is not NULL.
---
 src/video_output/video_output.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index c15dc2c8a67..cf83e96481a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1491,23 +1491,12 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     }
 
     if (!paused || frame_by_frame)
-        while (!sys->displayed.next)
+        if (!sys->displayed.next)
         {
-            picture_t *picture =
+            sys->displayed.next=
             ThreadDisplayPreparePicture(vout, false, frame_by_frame, &paused);
-
-            if (!picture)
-                break;
-
-            if (!sys->displayed.current)
-                sys->displayed.current = picture;
-            else
-                sys->displayed.next    = picture;
         }
 
-    if (!sys->displayed.current)
-        return VLC_EGENERIC; // wait with no known deadline
-
     const vlc_tick_t system_now = vlc_tick_now();
     const vlc_tick_t render_delay = vout_chrono_GetHigh(&sys->render) + VOUT_MWAIT_TOLERANCE;
 
-- 
2.26.2



More information about the vlc-devel mailing list