]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/wpl.c
various modules: adjust to new playlist design
[vlc] / modules / demux / playlist / wpl.c
index 488d2efd2eb89957a69dcbfc71de98ddca9b3979..98e8ef3960f760ecdf62e3f094534f821bfee78d 100644 (file)
@@ -78,6 +78,8 @@ static int Demux( demux_t *p_demux )
     char       *psz_line;
     input_item_t *p_current_input = GetCurrentItem(p_demux);
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     while( (psz_line = stream_ReadLine( p_demux->s )) )
     {
         char *psz_parse = psz_line;
@@ -101,6 +103,8 @@ static int Demux( demux_t *p_demux )
                 p_input = input_item_NewExt( p_demux, psz_uri, psz_uri,
                                         0, NULL, 0, -1 );
                 input_item_AddSubItem( p_current_input, p_input );
+                input_item_node_AppendItem( p_subitems, p_input );
+                vlc_gc_decref( p_input );
             }
         }
 
@@ -108,6 +112,10 @@ static int Demux( demux_t *p_demux )
         free( psz_line );
 
     }
+
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     var_Destroy( p_demux, "wpl-extvlcopt" );
     return 0; /* Needed for correct operation of go back */