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

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


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

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 64a4c3d1826..1dedc24c58a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1535,6 +1535,10 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     }
 
     if (display_next_frame) {
+        if (!sys->displayed.next)
+            // frame by frame mode, but there's no next picture to display yet
+            return VLC_EGENERIC;
+
         picture_Release(sys->displayed.current);
         if (first)
             // we got a current and a next and will only display the next
@@ -1544,9 +1548,6 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         sys->displayed.next    = NULL;
     }
 
-    if (!sys->displayed.current)
-        return VLC_EGENERIC;
-
     if (!current_needs_redisplay && !display_next_frame) {
         // we don't have to redisplay the current frame or display a new frame
         // we woke up and (pre)rendered pictures for nothing
-- 
2.26.2



More information about the vlc-devel mailing list