[vlc-devel] [PATCH] input: fix title update leak

Francois Cartegnie fcvlcdev at free.fr
Wed Dec 4 18:52:21 CET 2019


regression from fbec8c85c89d4120235f7e593d39f4ddd0402db9
---
 src/input/input.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/input/input.c b/src/input/input.c
index dd26edfd6b..6dbe72cc93 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2383,7 +2383,13 @@ static void UpdateTitleListfromDemux( input_thread_t *p_input )
 
     /* Delete the preexisting titles */
     bool had_titles = in->i_title > 0;
-
+    if( had_titles )
+    {
+        for( int i = 0; i < in->i_title; i++ )
+            vlc_input_title_Delete( in->title[i] );
+        TAB_CLEAN( in->i_title, in->title );
+    }
+msg_Err(p_input,"UpdateTitleListfromDemux");
     /* Get the new title list */
     if( demux_Control( in->p_demux, DEMUX_GET_TITLE_INFO,
                        &in->title, &in->i_title,
@@ -2668,6 +2674,7 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,
      * FIXME improve for b_preparsing: move it after GET_META and check psz_arturl */
     if( !input_priv(p_input)->b_preparsing )
     {
+        msg_Err(p_input,"InputSourceNew");
         if( demux_Control( in->p_demux, DEMUX_GET_TITLE_INFO,
                            &in->title, &in->i_title,
                            &in->i_title_offset, &in->i_seekpoint_offset ))
-- 
2.21.0



More information about the vlc-devel mailing list