]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/pls.c
input_item: compress two functions into one and rename "Add" into "Post" for clarity...
[vlc] / modules / demux / playlist / pls.c
index bd382b6f82d3f2f7e64f44ff4ba879a7196eb556..7bbdcb4e4f002d9ab0ccdb3e6d7b291f37f58ca0 100644 (file)
@@ -91,7 +91,9 @@ static int Demux( demux_t *p_demux )
     int            i_key_length;
     input_item_t *p_input;
 
-    INIT_PLAYLIST_STUFF;
+    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 ) ) )
     {
@@ -159,10 +161,9 @@ static int Demux( demux_t *p_demux )
         {
             if( psz_mrl )
             {
-                p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,
-                                            0, NULL, -1 );
-                input_ItemCopyOptions( p_current_input, p_input );
-                input_ItemAddSubItem( p_current_input, p_input );
+                p_input = input_item_New( p_demux, psz_mrl, psz_name );
+                input_item_CopyOptions( p_current_input, p_input );
+                input_item_node_AppendItem( p_subitems, p_input );
                 vlc_gc_decref( p_input );
             }
             else
@@ -215,9 +216,9 @@ static int Demux( demux_t *p_demux )
     /* Add last object */
     if( psz_mrl )
     {
-        p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name,0, NULL, -1 );
-        input_ItemCopyOptions( p_current_input, p_input );
-        input_ItemAddSubItem( p_current_input, p_input );
+        p_input = input_item_New( p_demux, psz_mrl, psz_name );
+        input_item_CopyOptions( p_current_input, p_input );
+        input_item_node_AppendItem( p_subitems, p_input );
         vlc_gc_decref( p_input );
         free( psz_mrl_orig );
         psz_mrl = NULL;
@@ -229,7 +230,9 @@ static int Demux( demux_t *p_demux )
     free( psz_name );
     psz_name = NULL;
 
-    HANDLE_PLAY_AND_RELEASE;
+    input_item_node_PostAndDelete( p_subitems );
+
+    vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
 }