]> git.sesse.net Git - vlc/blobdiff - src/playlist/item.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / playlist / item.c
index 8d152c34b777e781182acc882a2072717cd27dc5..ffb5464d3703445511943df62779bcb9905da444 100644 (file)
@@ -153,13 +153,14 @@ static void input_item_add_subitem_tree ( const vlc_event_t * p_event,
             }
             else
             {
-                p_play_item = playlist_GetNextLeaf( p_playlist,
-                                                    p_item,
-                                                    NULL,
-                                                    true,
-                                                    false );
-                char *psz_name = input_item_GetName(p_play_item->p_input);
-                free(psz_name);
+                p_play_item = p_item->pp_children[pos];
+                /* NOTE: this is a work around the general bug:
+                if node-to-be-played contains sub-nodes, then second instead
+                of first leaf starts playing (only in case the leafs have just
+                been instered and playlist has not yet been rebuilt.)
+                */
+                while( p_play_item->i_children > 0 )
+                    p_play_item = p_play_item->pp_children[0];
             }
 
             playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,