Commit e486d6b0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

playlist: remove constant playlist_ItemFindFromInputAndRoot() parameter

parent 25e9e187
...@@ -330,7 +330,7 @@ int playlist_DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input, ...@@ -330,7 +330,7 @@ int playlist_DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input,
PL_LOCK_IF( !b_locked ); PL_LOCK_IF( !b_locked );
p_item = playlist_ItemFindFromInputAndRoot( p_playlist, p_input, p_item = playlist_ItemFindFromInputAndRoot( p_playlist, p_input,
p_playlist->p_root, false ); p_playlist->p_root );
if( p_item != NULL ) if( p_item != NULL )
{ {
playlist_NodeDelete( p_playlist, p_item, false ); playlist_NodeDelete( p_playlist, p_item, false );
...@@ -586,18 +586,15 @@ int playlist_InsertInputItemTree ( ...@@ -586,18 +586,15 @@ int playlist_InsertInputItemTree (
* \param p_playlist the playlist object * \param p_playlist the playlist object
* \param p_item the input item * \param p_item the input item
* \param p_root root playlist 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 * \return the first found item, or NULL if not found
*/ */
playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist, playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
input_item_t *p_item, input_item_t *p_item,
playlist_item_t *p_root, playlist_item_t *p_root )
bool b_items_only )
{ {
for( int i = 0 ; i< p_root->i_children ; i++ ) for( int i = 0 ; i< p_root->i_children ; i++ )
{ {
if( ( b_items_only ? p_root->pp_children[i]->i_children == -1 : 1 ) && if( p_root->pp_children[i]->p_input == p_item )
p_root->pp_children[i]->p_input == p_item )
{ {
return p_root->pp_children[i]; return p_root->pp_children[i];
} }
...@@ -605,8 +602,7 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist, ...@@ -605,8 +602,7 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
{ {
playlist_item_t *p_search = playlist_item_t *p_search =
playlist_ItemFindFromInputAndRoot( p_playlist, p_item, playlist_ItemFindFromInputAndRoot( p_playlist, p_item,
p_root->pp_children[i], p_root->pp_children[i] );
b_items_only );
if( p_search ) return p_search; if( p_search ) return p_search;
} }
} }
......
...@@ -131,8 +131,7 @@ int playlist_NodeInsert(playlist_t *, playlist_item_t*, playlist_item_t *, ...@@ -131,8 +131,7 @@ int playlist_NodeInsert(playlist_t *, playlist_item_t*, playlist_item_t *,
int); int);
playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist, playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
input_item_t *p_input, playlist_item_t *p_root, input_item_t *p_input, playlist_item_t *p_root );
bool );
int playlist_DeleteFromItemId( playlist_t*, int ); int playlist_DeleteFromItemId( playlist_t*, int );
void playlist_ItemRelease( playlist_item_t * ); void playlist_ItemRelease( playlist_item_t * );
......
...@@ -196,8 +196,7 @@ static void playlist_sd_item_removed(services_discovery_t *sd, ...@@ -196,8 +196,7 @@ static void playlist_sd_item_removed(services_discovery_t *sd,
PL_LOCK; PL_LOCK;
playlist_item_t *p_item = playlist_item_t *p_item =
playlist_ItemFindFromInputAndRoot( p_playlist, p_input, playlist_ItemFindFromInputAndRoot( p_playlist, p_input, p_sd_node );
p_sd_node, false );
if( !p_item ) if( !p_item )
{ {
PL_UNLOCK; return; PL_UNLOCK; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment