]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/asx.c
various modules: adjust to new playlist design
[vlc] / modules / demux / playlist / asx.c
index 06810f66b2cc651cc622831e0b0598d5166ef4ca..5099c9a8cccda6f848bcbc2f711481c006b951ab 100644 (file)
@@ -261,6 +261,8 @@ static int Demux( demux_t *p_demux )
         if( p_sys->i_data_len <= 0 ) return -1;
     }
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     psz_parse = p_sys->psz_data;
     /* Find first element */
     if( ( psz_parse = strcasestr( psz_parse, "<ASX" ) ) )
@@ -472,6 +474,7 @@ static int Demux( demux_t *p_demux )
                             p_input = input_item_New( p_demux, psz_string, psz_title_asx );
                             input_item_CopyOptions( p_current_input, p_input );
                             input_item_AddSubItem( p_current_input, p_input );
+                            input_item_node_AppendItem( p_subitems, p_input );
                             vlc_gc_decref( p_input );
                             free( psz_string );
                         }
@@ -570,6 +573,7 @@ static int Demux( demux_t *p_demux )
                                 vlc_gc_decref( uniq_entry_ad_backup );
                             }
                             input_item_AddSubItem( p_current_input, p_entry );
+                            input_item_node_AppendItem( p_subitems, p_entry );
                             vlc_gc_decref( p_entry );
                         }
                     }
@@ -647,6 +651,7 @@ static int Demux( demux_t *p_demux )
                                 if( psz_moreinfo_entry ) input_item_SetURL( p_entry, psz_moreinfo_entry );
                                 if( psz_abstract_entry ) input_item_SetDescription( p_entry, psz_abstract_entry );
                                 input_item_AddSubItem( p_current_input, p_entry );
+                                input_item_node_AppendItem( p_subitems, p_entry );
                                 vlc_gc_decref( p_entry );
                             }
 
@@ -750,6 +755,7 @@ static int Demux( demux_t *p_demux )
             msg_Dbg( p_demux, "added unique entry even if ad");
             /* If ASX contains a unique entry, we add it, it is probably not an ad */
             input_item_AddSubItem( p_current_input, uniq_entry_ad_backup );
+            input_item_node_AppendItem( p_subitems, uniq_entry_ad_backup );
             vlc_gc_decref( uniq_entry_ad_backup);
         }
 #if 0
@@ -761,6 +767,10 @@ static int Demux( demux_t *p_demux )
             STARTMARK
 #endif
     }
+
+    input_item_AddSubItemTree( p_subitems );
+    input_item_node_Delete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     return 0; /* Needed for correct operation of go back */
 }