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

playlist: make PLAYLIST_END equal minus one

And simplify accordingly, notably inline playlist_NodeAppend().
parent d5f4d48d
......@@ -225,7 +225,7 @@ enum
#define PLAYLIST_SPREPARSE 0x0010
#define PLAYLIST_NO_REBUILD 0x0020
#define PLAYLIST_END -666
#define PLAYLIST_END -1
enum pl_locked_state
{
......
......@@ -822,11 +822,7 @@ static void AddItem( playlist_t *p_playlist, playlist_item_t *p_item,
ARRAY_APPEND(p_playlist->items, p_item);
ARRAY_APPEND(pl_priv(p_playlist)->all_items, p_item);
if( i_pos == PLAYLIST_END )
playlist_NodeAppend( p_playlist, p_item, p_node );
else
playlist_NodeInsert( p_playlist, p_item, p_node, i_pos );
playlist_NodeInsert( p_playlist, p_item, p_node, i_pos );
playlist_SendAddNotify( p_playlist, p_item->i_id, p_node->i_id,
!( i_mode & PLAYLIST_NO_REBUILD ) );
}
......
......@@ -127,7 +127,6 @@ int playlist_InsertInputItemTree ( playlist_t *,
playlist_item_t *, input_item_node_t *, int, bool );
/* Tree walking */
int playlist_NodeAppend(playlist_t *, playlist_item_t*, playlist_item_t *);
int playlist_NodeInsert(playlist_t *, playlist_item_t*, playlist_item_t *,
int);
......
......@@ -80,8 +80,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
ARRAY_APPEND(pl_priv(p_playlist)->all_items, p_item);
if( p_parent != NULL )
playlist_NodeInsert( p_playlist, p_item, p_parent,
i_pos == PLAYLIST_END ? -1 : i_pos );
playlist_NodeInsert( p_playlist, p_item, p_parent, i_pos );
playlist_SendAddNotify( p_playlist, p_item->i_id,
p_parent ? p_parent->i_id : -1,
!( i_flags & PLAYLIST_NO_REBUILD ));
......@@ -194,22 +193,6 @@ void playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
playlist_ItemRelease( p_root );
}
/**
* Adds an item to the children of a node
*
* \param p_playlist the playlist
* \param p_item the item to append
* \param p_parent the parent node
* \return VLC_SUCCESS or an error
*/
int playlist_NodeAppend( playlist_t *p_playlist,
playlist_item_t *p_item,
playlist_item_t *p_parent )
{
return playlist_NodeInsert( p_playlist, p_item, p_parent, -1 );
}
int playlist_NodeInsert( playlist_t *p_playlist,
playlist_item_t *p_item,
playlist_item_t *p_parent,
......
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