From: Derk-Jan Hartman Date: Sun, 24 Aug 2008 12:09:06 +0000 (+0200) Subject: macosx: set the correct node when we add items and play them at once. X-Git-Tag: 0.9.0~38 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=086939730f60d6ffe9155ec1621883f246bdf31f;p=vlc 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 ) --- diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 5dad4232ce..a03cbd1c60 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 );