+ { /* delete the corresponding item */
+ p_pl_item = playlist_ItemGetById( p_playlist,
+ p_sys->pp_devices[i]->i_id, VLC_FALSE );
+ if( p_pl_item )
+ {
+ j = 0;
+ while( p_pl_item->i_children > 0 )
+ { /* delete all childs */
+ playlist_DeleteFromInput( p_playlist,
+ p_pl_item->pp_children[j]->p_input->i_id, VLC_FALSE );
+ }
+ /* delete parent item */
+
+ /* HACK: if i_children == 0 the item won't be deleted
+ * That means that it _had_ children but they were deleted */
+ if( p_pl_item->i_children == 0 )
+ p_pl_item->i_children = -1;
+
+ playlist_DeleteFromInput( p_playlist,
+ p_pl_item->p_input->i_id, VLC_FALSE );
+ }
+
+ if( p_sys->pp_devices[i]->psz_udi )
+ free( p_sys->pp_devices[i]->psz_udi );