vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun May 14 14:14:07 2017 +0300| [1144801418571781ec2cc8cc6189d459ca9e7c20] | committer: Rémi Denis-Courmont
playlist: create a playlist node depending on item type If the input item for the new playlist item is already of type node, assume that the caller wants to create a new playlist node. This skips calling ChangeToNode() later and incurred processing in interfaces. This also enables some further code factorization. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1144801418571781ec2cc8cc6189d459ca9e7c20 --- src/playlist/item.c | 2 +- src/playlist/tree.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/playlist/item.c b/src/playlist/item.c index 692cb1d073..08d0ff015e 100644 --- a/src/playlist/item.c +++ b/src/playlist/item.c @@ -249,7 +249,7 @@ playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist, p_item->p_input = p_input; p_item->i_id = p->i_last_playlist_id; p_item->p_parent = NULL; - p_item->i_children = -1; + p_item->i_children = (p_input->i_type == ITEM_TYPE_NODE) ? 0 : -1; p_item->pp_children = NULL; p_item->i_nb_played = 0; p_item->i_flags = 0; diff --git a/src/playlist/tree.c b/src/playlist/tree.c index a50c620a49..10f3be994a 100644 --- a/src/playlist/tree.c +++ b/src/playlist/tree.c @@ -74,7 +74,6 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist, input_item_Release( p_new_input ); if( p_item == NULL ) return NULL; - p_item->i_children = 0; if( p_parent != NULL ) playlist_NodeInsert( p_parent, p_item, i_pos ); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
