[vlc-commits] playlist: remove constant playlist_ItemFindFromInputAndRoot() parameter

Rémi Denis-Courmont git at videolan.org
Wed Nov 16 19:49:37 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov 16 20:49:16 2016 +0200| [e486d6b0f58a239ac8945d9056e7bbd5424ba622] | committer: Rémi Denis-Courmont

playlist: remove constant playlist_ItemFindFromInputAndRoot() parameter

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

 src/playlist/item.c               | 12 ++++--------
 src/playlist/playlist_internal.h  |  3 +--
 src/playlist/services_discovery.c |  3 +--
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index 31c0618..6538e2b 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -330,7 +330,7 @@ int playlist_DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input,
 
     PL_LOCK_IF( !b_locked );
     p_item = playlist_ItemFindFromInputAndRoot( p_playlist, p_input,
-                                                p_playlist->p_root, false );
+                                                p_playlist->p_root );
     if( p_item != NULL )
     {
         playlist_NodeDelete( p_playlist, p_item, false );
@@ -586,18 +586,15 @@ int playlist_InsertInputItemTree (
  * \param p_playlist the playlist object
  * \param p_item the input item
  * \param p_root root playlist item
- * \param b_items_only TRUE if we want the item himself
  * \return the first found item, or NULL if not found
  */
 playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
                                                     input_item_t *p_item,
-                                                    playlist_item_t *p_root,
-                                                    bool b_items_only )
+                                                    playlist_item_t *p_root )
 {
     for( int i = 0 ; i< p_root->i_children ; i++ )
     {
-        if( ( b_items_only ? p_root->pp_children[i]->i_children == -1 : 1 ) &&
-            p_root->pp_children[i]->p_input == p_item )
+        if( p_root->pp_children[i]->p_input == p_item )
         {
             return p_root->pp_children[i];
         }
@@ -605,8 +602,7 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
         {
             playlist_item_t *p_search =
                  playlist_ItemFindFromInputAndRoot( p_playlist, p_item,
-                                                    p_root->pp_children[i],
-                                                    b_items_only );
+                                                    p_root->pp_children[i] );
             if( p_search ) return p_search;
         }
     }
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index c081c98..d92a75a 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -131,8 +131,7 @@ int playlist_NodeInsert(playlist_t *, playlist_item_t*, playlist_item_t *,
                         int);
 
 playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
-                                input_item_t *p_input, playlist_item_t *p_root,
-                                bool );
+                              input_item_t *p_input, playlist_item_t *p_root );
 
 int playlist_DeleteFromItemId( playlist_t*, int );
 void playlist_ItemRelease( playlist_item_t * );
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index fc31c9a..c072a66 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -196,8 +196,7 @@ static void playlist_sd_item_removed(services_discovery_t *sd,
 
     PL_LOCK;
     playlist_item_t *p_item =
-        playlist_ItemFindFromInputAndRoot( p_playlist, p_input,
-                                           p_sd_node, false );
+        playlist_ItemFindFromInputAndRoot( p_playlist, p_input, p_sd_node );
     if( !p_item )
     {
         PL_UNLOCK; return;



More information about the vlc-commits mailing list