[vlc-devel] [PATCH v2 13/18] video_output: return early if we tried to render pictures but none were found

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


If we don't have any displayed.current at this stage we won't have one later
and so there no need checking for redisplay, next frame, etc. We're not going
to display anything.

deadline is always INFINITE_DEADLINE in this case. It would have been
INFINITE_DEADLINE anyway, as there cannot be a displayed.next since
displayed.current is NULL and there cannot be no displayed.current with a
displayed.date set (it would have picked displayed.decoded otherwise). These
are the case where we set a proper deadline value.
---
 src/video_output/video_output.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index add2c90df36..98832588ce8 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1502,6 +1502,9 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
             && !ThreadDisplayPreparePicture(vout, false, frame_by_frame, &paused))
             ;
 
+    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