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

playlist: inline playlist_DeleteFromItemId()

parent 50c44e46
......@@ -357,24 +357,6 @@ void playlist_Clear( playlist_t * p_playlist, bool b_locked )
PL_UNLOCK_IF( !b_locked );
}
/**
* Delete playlist item
*
* Remove a playlist item from the playlist, given its id
* This function is to be used only by the playlist
* \param p_playlist playlist object
* \param i_id id of the item do delete
* \return VLC_SUCCESS or an error
*/
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;
playlist_NodeDelete( p_playlist, p_item, false );
return VLC_SUCCESS;
}
/***************************************************************************
* Playlist item addition
***************************************************************************/
......
......@@ -132,7 +132,6 @@ int playlist_NodeInsert(playlist_t *, playlist_item_t*, playlist_item_t *,
playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
input_item_t *p_input, playlist_item_t *p_root );
int playlist_DeleteFromItemId( playlist_t*, int );
void playlist_ItemRelease( playlist_item_t * );
void playlist_NodeEmpty( playlist_t *, playlist_item_t * );
......
......@@ -103,18 +103,7 @@ void playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root )
/* Delete the children */
for( int i = p_root->i_children-1 ; i >= 0 ;i-- )
{
if( p_root->pp_children[i]->i_children > -1 )
{
playlist_NodeDelete( p_playlist, p_root->pp_children[i], false );
}
else
{
/* Delete the item here */
playlist_DeleteFromItemId( p_playlist,
p_root->pp_children[i]->i_id );
}
}
playlist_NodeDelete( p_playlist, p_root->pp_children[i], false );
}
/**
......
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