]> git.sesse.net Git - vlc/blobdiff - src/playlist/item.c
Used the right object for messages in src/input/decoder.c
[vlc] / src / playlist / item.c
index 8d152c34b777e781182acc882a2072717cd27dc5..0de77a537ab875d3d1a323a191b214b9df37c146 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,
@@ -713,10 +714,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
     add.i_item = i_item_id;
     add.i_node = i_node_id;
 
-    vlc_value_t val;
-    val.p_address = &add;
-
-    var_Set( p_playlist, "playlist-item-append", val );
+    var_SetAddress( p_playlist, "playlist-item-append", &add );
 }
 
 /***************************************************************************