[vlc-commits] macosx: start the right playlist item when adding new ones

David Fuhrmann git at videolan.org
Wed Feb 15 16:03:46 CET 2012


vlc/vlc-2.0 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Wed Feb 15 15:14:34 2012 +0100| [48e1b565ddc11f8ddc3f2e1e99c13eb81142b83e] | committer: Jean-Baptiste Kempf

macosx: start the right playlist item when adding new ones

fixes #6048

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit ef8a9e7e3aef1d64a969047059ba5c8ad6c6873b)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=48e1b565ddc11f8ddc3f2e1e99c13eb81142b83e
---

 modules/gui/macosx/playlist.m |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index ff88139..86f45ac 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -1124,18 +1124,16 @@
         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



More information about the vlc-commits mailing list