- playlist_AddName( p_playlist,
- *ppsz_name ? *ppsz_name : *ppsz_uri,
- *ppsz_uri,
- PLAYLIST_INSERT, *pi_position );
- (*pi_position)++;
- if( *ppsz_name )
+ playlist_item_t *p_item =
+ playlist_ItemNew( p_playlist, *ppsz_uri, *ppsz_name );
+ int i;
+
+ for( i = 0; i < *pi_options; i++ )
+ {
+ playlist_ItemAddOption( p_item, *pppsz_options[i] );
+ }
+
+ playlist_NodeAddItem( p_playlist, p_item,
+ p_parent->pp_parents[0]->i_view,
+ p_parent, PLAYLIST_APPEND, PLAYLIST_END );
+
+ /* We need to declare the parents of the node as the
+ * same of the parent's ones */
+ playlist_CopyParents( p_parent, p_item );
+
+ vlc_input_item_CopyOptions( &p_parent->input, &p_item->input );
+
+ if( *ppsz_name ) free( *ppsz_name ); *ppsz_name = NULL;
+ free( *ppsz_uri ); *ppsz_uri = NULL;
+
+ for( ; *pi_options; (*pi_options)-- )