- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
- VLC_FALSE, p_item_in_category, NULL );
+ /* Then, transform to a node if needed */
+ p_item_in_category = playlist_ItemFindFromInputAndRoot(
+ p_playlist, p_parent->i_id,
+ p_playlist->p_root_category,
+ false /* Only non-node */ );
+ if( !p_item_in_category )
+ {
+ /* Item may have been removed */
+ PL_UNLOCK;
+ return;
+ }
+
+ b_play = b_play &&
+ p_item_in_category == get_current_status_item( p_playlist );
+
+ /* If this item is already a node don't transform it */
+ if( p_item_in_category->i_children == -1 )
+ {
+ p_item_in_category = playlist_ItemToNode( p_playlist,
+ p_item_in_category, pl_Locked );
+ p_item_in_category->p_input->i_type = ITEM_TYPE_PLAYLIST;
+ }
+
+ int i_ret = playlist_BothAddInput( p_playlist, p_child,
+ p_item_in_category,
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE , PLAYLIST_END,
+ NULL, NULL, pl_Locked );
+
+ if( i_ret == VLC_SUCCESS && b_play )
+ {
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
+ pl_Locked, p_item_in_category, NULL );
+ }