[vlc-devel] [PATCH v2 16/18] video_output: return error if we don't have a next picture to display

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


A request to render the next frame in frame by frame was handled but we don't
have a next picture yet. We should not forget about the displayed.current as
triggered by display_next_frame. We keep the current state as it is.

The other case where display_next_frame is set to true only happens if there is
a displayed.next.

No need to return error in the general case anymore, that's the only place
displayed.current could become NULL.
---
 src/video_output/video_output.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index cf83e96481a..95ade086b5b 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1502,6 +1502,10 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
 
     bool display_next_frame = frame_by_frame && !first;
 
+    if (display_next_frame && !sys->displayed.next)
+        // frame by frame mode, but there's no next picture to display yet
+        return VLC_EGENERIC; // wait with no known deadline
+
     /* FIXME/XXX we must redisplay the last decoded picture (because
      * of potential vout updated, or filters update or SPU update)
      * For now a high update period is needed but it could be removed
@@ -1557,9 +1561,6 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         sys->displayed.next    = NULL;
     }
 
-    if (!sys->displayed.current)
-        return VLC_EGENERIC;
-
     /* display the picture immediately */
     bool immediate = frame_by_frame || force_refresh || sys->displayed.current->b_force;
     int ret = ThreadDisplayRenderPicture(vout, immediate);
-- 
2.26.2



More information about the vlc-devel mailing list