[vlc-devel] commit: macosx: set the correct node when we add items and play them at once. ( Derk-Jan Hartman )

git version control git at videolan.org
Sun Aug 24 14:08:02 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Sun Aug 24 14:09:06 2008 +0200| [086939730f60d6ffe9155ec1621883f246bdf31f] | committer: Derk-Jan Hartman 

macosx: set the correct node when we add items and play them at once.

This fixes #1807
For Mac OS X that is. We might want to consider changing the default behaviour of playlist_Control( PLAYLIST_VIEWPLAY )

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=086939730f60d6ffe9155ec1621883f246bdf31f
---

 modules/gui/macosx/playlist.m |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 5dad423..a03cbd1 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -1031,9 +1031,23 @@
 
         if( i_item == 0 && !b_enqueue )
         {
-            playlist_item_t *p_item;
+            playlist_item_t *p_item = NULL;
+            playlist_item_t *p_node = NULL;
             p_item = playlist_ItemGetByInput( p_playlist, p_input, pl_Locked );
-            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, NULL, p_item );
+            if( p_item )
+            {
+                if( p_item->i_children == -1 )
+                    p_node = p_item->p_parent;
+                else
+                {
+                    p_node = p_item;
+                    if( p_node->i_children > 0 && p_node->pp_children[0]->i_children == -1 )
+                        p_item = p_node->pp_children[0];
+                    else
+                        p_item = NULL;
+                }
+                playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, p_node, p_item );
+            }
         }
         vlc_gc_decref( p_input );
     }
@@ -1073,7 +1087,7 @@
         {
             playlist_item_t *p_item;
             p_item = playlist_ItemGetByInput( p_playlist, p_input, pl_Locked );
-            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, NULL, p_item );
+            playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, p_node, p_item );
         }
         PL_UNLOCK;
         vlc_gc_decref( p_input );




More information about the vlc-devel mailing list