]> git.sesse.net Git - vlc/commitdiff
macosx: start the right playlist item when adding new ones
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Wed, 15 Feb 2012 14:14:34 +0000 (15:14 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 15 Feb 2012 15:01:03 +0000 (16:01 +0100)
fixes #6048

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/macosx/playlist.m

index ff88139a4c40f3a708b41c1726c982d742254b9b..86f45acb8ec711521736dc1aa842cc665ee152d9 100644 (file)
         playlist_AddInput( p_playlist, p_input, PLAYLIST_INSERT, i_position == -1 ? PLAYLIST_END : i_position + i_item, b_usingPlaylist,
          pl_Locked );
 
+        if( i_item == 0 && !b_enqueue )
+        {
+            playlist_item_t *p_item = playlist_ItemGetByInput( p_playlist, p_input );
+            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, p_item->p_parent, p_item );
+        }
+
         vlc_gc_decref( p_input );
     }
     PL_UNLOCK;
-    if( i_position == -1 )
-        i_position = [o_outline_dict count] - 1;
-
     [self playlistUpdated];
-    if( !b_enqueue )
-    {
-        [o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:i_position] byExtendingSelection:NO];
-        [self playItem:nil];
-    }
 }
 
 - (void)appendNodeArray:(NSArray*)o_array inNode:(playlist_item_t *)p_node atPos:(int)i_position enqueue:(BOOL)b_enqueue