[vlc-devel] [PATCH 01/39] video_output: don't use the decoder FIFO if it has been deleted

Steve Lhomme robux4 at ycbcr.xyz
Mon Oct 7 16:28:40 CEST 2019


For example if the vout didn't start properly.
---
 src/video_output/video_output.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index eb022fb2ac0..21d55bc89cb 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -223,6 +223,9 @@ void vout_GetResetStatistic(vout_thread_t *vout, unsigned *restrict displayed,
 bool vout_IsEmpty(vout_thread_t *vout)
 {
     assert(!vout->p->dummy);
+    if (!vout->p->decoder_fifo)
+        return true;
+
     picture_t *picture = picture_fifo_Peek(vout->p->decoder_fifo);
     if (picture)
         picture_Release(picture);
@@ -1596,7 +1599,10 @@ error:
         filter_chain_Delete(sys->filter.chain_static);
     video_format_Clean(&sys->filter.format);
     if (sys->decoder_fifo != NULL)
+    {
         picture_fifo_Delete(sys->decoder_fifo);
+        sys->decoder_fifo = NULL;
+    }
     return VLC_EGENERIC;
 }
 
@@ -1706,7 +1712,10 @@ void vout_StopDisplay(vout_thread_t *vout)
     free(sys->filter.configuration);
 
     if (sys->decoder_fifo != NULL)
+    {
         picture_fifo_Delete(sys->decoder_fifo);
+        sys->decoder_fifo = NULL;
+    }
     assert(sys->decoder_pool == NULL);
 
     if (sys->mouse_event)
-- 
2.17.1



More information about the vlc-devel mailing list