- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
- VLC_FALSE, p_item_in_category, NULL );
+ b_play = b_play && p_item_in_category == p_playlist->status.p_item;
+
+ /* Then, transform to a node if needed */
+ p_item_in_category = playlist_ItemFindFromInputAndRoot(
+ p_playlist, p_parent->i_id,
+ p_playlist->p_root_category,
+ VLC_FALSE /* Only non-node */ );
+ if( !p_item_in_category )
+ {
+ /* Item may have been removed */
+ PL_UNLOCK;
+ return
+ }
+
+ /* 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, VLC_TRUE );
+ }
+
+ playlist_BothAddInput( p_playlist, p_child, p_item_in_category,
+ PLAYLIST_APPEND | PLAYLIST_SPREPARSE , PLAYLIST_END,
+ NULL, NULL, VLC_TRUE );
+
+ if( b_play )
+ {
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
+ VLC_TRUE, p_item_in_category, NULL );
+ }