[vlc-devel] [PATCH 08/11] vout: vout_Flush: check display

Thomas Guillem thomas at gllm.fr
Tue Jun 30 17:27:19 CEST 2020


That way, the caller doesn't have to know if the vout is started to safely
call vout_Flush().
---
 src/video_output/video_output.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 480dfe75f37..793435887f1 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1405,20 +1405,22 @@ static void vout_FlushUnlocked(vout_thread_t *vout, bool below,
 
     picture_fifo_Flush(sys->decoder_fifo, date, below);
 
-    assert(sys->display != NULL);
     vlc_mutex_lock(&sys->display_lock);
-    vout_FilterFlush(sys->display);
+    if (sys->display != NULL)
+        vout_FilterFlush(sys->display);
     vlc_mutex_unlock(&sys->display_lock);
 
-    vlc_clock_Reset(sys->clock);
-    vlc_clock_SetDelay(sys->clock, sys->delay);
+    if (sys->clock != NULL)
+    {
+        vlc_clock_Reset(sys->clock);
+        vlc_clock_SetDelay(sys->clock, sys->delay);
+    }
 }
 
 void vout_Flush(vout_thread_t *vout, vlc_tick_t date)
 {
     vout_thread_sys_t *sys = vout->p;
     assert(!sys->dummy);
-    assert(sys->display);
 
     vout_control_Hold(&sys->control);
     vout_FlushUnlocked(vout, false, date);
-- 
2.20.1



More information about the vlc-devel mailing list