]> git.sesse.net Git - vlc/blobdiff - src/input/item.c
* Allow service discoveries to state whether they prefer being displayed as tree
[vlc] / src / input / item.c
index 9f893b73db02c66732282c4ef5573f6741c9024d..40fb6d5acb87519bd2bd2f8bf9004f607e9a4b1e 100644 (file)
@@ -70,19 +70,17 @@ char *vlc_input_item_GetInfo( input_item_t *p_i,
 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 &&
@@ -101,6 +99,16 @@ static void vlc_input_item_Destroy ( gc_object_t *p_this )
             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 );
@@ -248,6 +256,7 @@ input_item_t *input_ItemNewWithType( vlc_object_t *p_obj, const char *psz_uri,
         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 );