]> git.sesse.net Git - vlc/commitdiff
playlist/item.c: Better subitem added handling code.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 17 Aug 2007 09:48:55 +0000 (09:48 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 17 Aug 2007 09:48:55 +0000 (09:48 +0000)
src/playlist/item.c

index 31eaf8bc6aec715601a5893903383044984d96ea..e70c39b55a874db7321e8f1270f06705692ac03e 100644 (file)
@@ -50,12 +50,11 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
     p_child = p_event->u.input_item_subitem_added.p_new_child;
 
     p_current = playlist_ItemGetByInput( p_playlist, p_parent, VLC_FALSE );
-    if( p_current->i_children == -1 )
-        p_item_in_category = playlist_ItemToNode( p_playlist, p_current,
+    p_item_in_category = playlist_ItemToNode( p_playlist, p_current,
                                               VLC_FALSE );
-    else
+    if(!p_item_in_category)
         p_item_in_category = p_current;
-    p_item_in_category = p_current;
+
     b_play = b_play && p_current == p_playlist->status.p_item;
 
     playlist_NodeAddInput( p_playlist, p_child, p_item_in_category,