]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/zpl.c
various modules: adjust to new playlist design
[vlc] / modules / demux / playlist / zpl.c
index 8d64afc47ff36a56a35e31629c04487a68dc1825..b9ee3d23b4c3f5d363e1373a33fe587a7a3bc224 100644 (file)
@@ -103,6 +103,8 @@ static int Demux( demux_t *p_demux )
         psz_line = stream_ReadLine( p_demux->s );
     }
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     /* Loop on all lines */
     while( psz_line )
     {
@@ -167,6 +169,7 @@ static int Demux( demux_t *p_demux )
             input_item_t *p_input = input_item_NewExt( p_demux, psz_mrl,
                                         psz_title, 0, NULL, 0, i_duration );
             input_item_AddSubItem( p_current_input, p_input );
+            input_item_node_AppendItem( p_subitems, p_input );
             FREENULL( psz_mrl );
             FREENULL( psz_title );
             i_duration = -1;
@@ -189,6 +192,7 @@ static int Demux( demux_t *p_demux )
             SET( psz_copyright, Copyright );
 #undef SET
 
+            vlc_gc_decref( p_input );
         }
         else
             msg_Warn( p_demux, "invalid line '%s'", psz_parse );
@@ -198,6 +202,9 @@ static int Demux( demux_t *p_demux )
         psz_line = stream_ReadLine( p_demux->s );
     }
 
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     var_Destroy( p_demux, "zpl-extvlcopt" );
     return 0; /* Needed for correct operation of go back */