[vlc-commits] playlist: inline playlist_DeleteItem

Rémi Denis-Courmont git at videolan.org
Tue Nov 15 21:04:43 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 15 21:40:07 2016 +0200| [03098679b04f9d5f1eb93a3912135789c2fa70f4] | committer: Rémi Denis-Courmont

playlist: inline playlist_DeleteItem

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03098679b04f9d5f1eb93a3912135789c2fa70f4
---

 src/playlist/item.c               | 14 +++-----------
 src/playlist/playlist_internal.h  |  1 -
 src/playlist/services_discovery.c |  2 +-
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index d2b6272..36320e6 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -110,7 +110,7 @@ static void input_item_add_subitem_tree ( const vlc_event_t * p_event,
         }
         assert( i < p_parent->i_children );
 
-        playlist_DeleteItem( p_playlist, p_item, true );
+        playlist_NodeDelete( p_playlist, p_item, true, false );
 
         /* If there is a pending request referring to the item we just deleted
          * it needs to be updated so that we do not try to play an entity that
@@ -337,7 +337,7 @@ static int DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input,
     playlist_item_t *p_item = playlist_ItemFindFromInputAndRoot(
         p_playlist, p_input, p_root, false );
     if( !p_item ) return VLC_EGENERIC;
-    return playlist_DeleteItem( p_playlist, p_item, b_do_stop );
+    return playlist_NodeDelete( p_playlist, p_item, true, false );
 }
 
 /**
@@ -409,7 +409,7 @@ int playlist_DeleteFromItemId( playlist_t *p_playlist, int i_id )
     PL_ASSERT_LOCKED;
     playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id );
     if( !p_item ) return VLC_EGENERIC;
-    return playlist_DeleteItem( p_playlist, p_item, true );
+    return playlist_NodeDelete( p_playlist, p_item, true, false );
 }
 
 /***************************************************************************
@@ -859,14 +859,6 @@ static void ChangeToNode( playlist_t *p_playlist, playlist_item_t *p_item )
         ARRAY_REMOVE( p_playlist->items, i );
 }
 
-/* Do the actual removal */
-int playlist_DeleteItem( playlist_t * p_playlist, playlist_item_t *p_item,
-                        bool b_stop )
-{
-    assert( b_stop );
-    return playlist_NodeDelete( p_playlist, p_item, true, false );
-}
-
 static int RecursiveAddIntoParent (
     playlist_t *p_playlist, playlist_item_t *p_parent,
     input_item_node_t *p_node, int i_pos, bool b_flat,
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index d655dc3..988e0af 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -138,7 +138,6 @@ int playlist_DeleteFromItemId( playlist_t*, int );
 int playlist_ItemRelease( playlist_item_t * );
 
 int playlist_NodeEmpty( playlist_t *, playlist_item_t *, bool );
-int playlist_DeleteItem( playlist_t * p_playlist, playlist_item_t *, bool);
 
 void ResetCurrentlyPlaying( playlist_t *p_playlist, playlist_item_t *p_cur );
 void ResyncCurrentIndex( playlist_t *p_playlist, playlist_item_t *p_cur );
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 8946eea..a360f73 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -206,7 +206,7 @@ static void playlist_sd_item_removed(services_discovery_t *sd,
     /* if the item was added under a category and the category node
        becomes empty, delete that node as well */
     if( p_parent->i_children > 1 || p_parent == p_sd_node )
-        playlist_DeleteItem( p_playlist, p_item, true );
+        playlist_NodeDelete( p_playlist, p_item, true, false );
     else
         playlist_NodeDelete( p_playlist, p_parent, true, true );
     PL_UNLOCK;



More information about the vlc-commits mailing list