[vlc-commits] playlist: inline playlist_NodeEmpty()

Rémi Denis-Courmont git at videolan.org
Wed Nov 16 23:05:06 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov 16 22:19:52 2016 +0200| [4630d8e25a64fb748c05ecb78375a9f2057c0923] | committer: Rémi Denis-Courmont

playlist: inline playlist_NodeEmpty()

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

 src/playlist/item.c              |  7 ++++++-
 src/playlist/playlist_internal.h |  2 --
 src/playlist/tree.c              | 20 --------------------
 3 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index ba49d6f..9a11e6c 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -352,8 +352,13 @@ int playlist_DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input,
  */
 void playlist_Clear( playlist_t * p_playlist, bool b_locked )
 {
+    playlist_item_t *p_root = p_playlist->p_playing;
+
     PL_LOCK_IF( !b_locked );
-    playlist_NodeEmpty( p_playlist, p_playlist->p_playing );
+
+    for( int i = p_root->i_children - 1; i >= 0 ;i-- )
+        playlist_NodeDelete( p_playlist, p_root->pp_children[i], false );
+
     PL_UNLOCK_IF( !b_locked );
 }
 
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index 04a4f3c..96bd8ad 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -134,8 +134,6 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
 
 void playlist_ItemRelease( playlist_item_t * );
 
-void playlist_NodeEmpty( playlist_t *, playlist_item_t * );
-
 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/tree.c b/src/playlist/tree.c
index 88e99bb..ad41bd2 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -87,26 +87,6 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
 }
 
 /**
- * Remove all the children of a node
- *
- * This function must be entered with the playlist lock
- *
- * \param p_playlist the playlist
- * \param p_root the node
- */
-void playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root )
-{
-    PL_ASSERT_LOCKED;
-
-    if( p_root->i_children == -1 )
-        return;
-
-    /* Delete the children */
-    for( int i = p_root->i_children-1 ; i >= 0 ;i-- )
-        playlist_NodeDelete( p_playlist, p_root->pp_children[i], false );
-}
-
-/**
  * Remove all the children of a node and removes the node
  *
  * \param p_playlist the playlist



More information about the vlc-commits mailing list