- playlist_item_t *p_item = playlist_ItemNew( p_playlist, psz_mrl,
- psz_name );
-
- playlist_NodeAddItem( p_playlist,p_item,
- p_parent->pp_parents[0]->i_view,
- p_parent,
- PLAYLIST_APPEND, PLAYLIST_END );
-
- playlist_CopyParents( p_parent, p_item );
- if( i_duration != -1 )
- {
- //playlist_SetDuration( p_playlist, i_position, i_duration );
- }
- i_position++;
- free( psz_mrl );
- psz_mrl = NULL;
-
- vlc_input_item_CopyOptions( &p_parent->input,
- &p_item->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 );