[vlc-devel] [RFC PATCH 3/8] input: Delete the demux_filter chain upon input deletion

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Jul 6 19:14:26 CEST 2017


This allows a demux_filter to be removed from the chain without
removing the entire chain at once.
---
 modules/stream_out/chromecast/chromecast_demux.cpp |  2 --
 src/input/input.c                                  | 11 ++++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast_demux.cpp b/modules/stream_out/chromecast/chromecast_demux.cpp
index 12dbdb1bf3..06536d1a27 100644
--- a/modules/stream_out/chromecast/chromecast_demux.cpp
+++ b/modules/stream_out/chromecast/chromecast_demux.cpp
@@ -66,8 +66,6 @@ struct demux_sys_t
     {
         p_renderer->pf_set_title( p_renderer->p_opaque, NULL );
         p_renderer->pf_set_artwork( p_renderer->p_opaque, NULL );
-
-        demux_Delete(p_demux->p_next);
     }
 
     void setPauseState(bool paused)
diff --git a/src/input/input.c b/src/input/input.c
index 665a25986f..fa4451ab92 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2570,7 +2570,16 @@ static void InputSourceDestroy( input_source_t *in )
     int i;
 
     if( in->p_demux )
-        demux_Delete( in->p_demux );
+    {
+        demux_t *p_demux = in->p_demux;
+        while( demux_IsDemuxFilter( p_demux ) )
+        {
+            demux_t *p_tmp = p_demux;
+            p_demux = p_demux->p_next;
+            demux_Delete( p_tmp );
+        }
+        demux_Delete( p_demux );
+    }
 
     if( in->i_title > 0 )
     {
-- 
2.11.0



More information about the vlc-devel mailing list