static void vlc_input_item_Destroy ( gc_object_t *p_this )
{
vlc_object_t *p_obj = (vlc_object_t *)p_this->p_destructor_arg;
- int i, i_top, i_bottom;
+ int i;
input_item_t *p_input = (input_item_t *) p_this;
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_obj,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
- fprintf( stderr, "Destroying item %s\n", p_input->psz_name );
-
-
vlc_input_item_Clean( p_input );
if( p_playlist )
{
+#if 0
i_bottom = 0; i_top = p_playlist->i_input_items - 1;
i = i_top / 2;
while( p_playlist->pp_input_items[i]->i_id != p_input->i_id &&
REMOVE_ELEM( p_playlist->pp_input_items,
p_playlist->i_input_items, i );
}
+#endif
+ for( i = 0 ; i< p_playlist->i_input_items ; i++ )
+ {
+ if( p_playlist->pp_input_items[i]->i_id == p_input->i_id )
+ {
+ REMOVE_ELEM( p_playlist->pp_input_items,
+ p_playlist->i_input_items, i );
+ break;
+ }
+ }
vlc_object_release( p_playlist );
}
free( p_input );
p_input->psz_name = strdup ( p_input->psz_uri );
p_input->i_type = i_type;
+ p_input->b_prefers_tree = VLC_FALSE;
if( p_input->i_type == ITEM_TYPE_UNKNOWN )
GuessType( p_input );