[vlc-devel] [PATCH 2/4] video_output: move up a test on NULL displayed.current

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 10 13:27:46 CET 2020


It can only become NULL if the next picture is not available yet in frame by
frame mode.
---
 src/video_output/video_output.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 62c9e854fce..0107a195a8e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1497,6 +1497,9 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
             sys->displayed.next = NULL;
         }
 
+        if (!sys->displayed.current)
+            return VLC_EGENERIC;
+
         render_now = true;
     }
     else
@@ -1564,9 +1567,6 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         }
     }
 
-    if (!sys->displayed.current)
-        return VLC_EGENERIC;
-
     /* display the picture immediately */
     render_now |= sys->displayed.current->b_force;
     int ret = ThreadDisplayRenderPicture(vout, render_now);
-- 
2.26.2



More information about the vlc-devel mailing list