From e25c0df1323e46a22414940c5c58256d2f2ab08a Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Tue, 15 Jul 2008 19:24:34 +0200 Subject: [PATCH] macosx: Use pl_Locked for better readability. --- modules/gui/macosx/playlist.m | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 69d9fbbc90..57bd2b95c1 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -562,12 +562,6 @@ existence first since OSX sometimes tries to redraw items that have been deleted. We don't do it when not required since this verification takes quite a long time on big playlists (yes, pretty hacky). */ -- (BOOL)isItem: (playlist_item_t *)p_item - inNode: (playlist_item_t *)p_node - checkItemExistence:(BOOL)b_check -{ - [self isItem:p_item inNode:p_node checkItemExistence:b_check locked:NO]; -} - (BOOL)isItem: (playlist_item_t *)p_item inNode: (playlist_item_t *)p_node @@ -629,6 +623,13 @@ return NO; } +- (BOOL)isItem: (playlist_item_t *)p_item + inNode: (playlist_item_t *)p_node + checkItemExistence:(BOOL)b_check +{ + [self isItem:p_item inNode:p_node checkItemExistence:b_check locked:NO]; +} + /* This method is usefull for instance to remove the selected children of an already selected node */ - (void)removeItemsFrom:(id)o_items ifChildrenOf:(id)o_nodes @@ -748,7 +749,7 @@ p_item = NULL; } } - playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, false, p_node, p_item ); + playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Unlocked, p_node, p_item ); } vlc_object_release( p_playlist ); } @@ -856,7 +857,7 @@ playlist_NodeDelete( p_playlist, p_item, true, false ); } else - playlist_DeleteFromInput( p_playlist, p_item->p_input->i_id, true ); + playlist_DeleteFromInput( p_playlist, p_item->p_input->i_id, pl_Locked ); } PL_UNLOCK; @@ -1017,13 +1018,13 @@ playlist_AddInput( p_playlist, p_input, PLAYLIST_INSERT, i_position == -1 ? PLAYLIST_END : i_position + i_item, true, - true ); + pl_Locked ); if( i_item == 0 && !b_enqueue ) { playlist_item_t *p_item; - p_item = playlist_ItemGetByInput( p_playlist, p_input, true ); - playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, true, NULL, p_item ); + p_item = playlist_ItemGetByInput( p_playlist, p_input, pl_Locked ); + playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, NULL, p_item ); } vlc_gc_decref( p_input ); } @@ -1051,19 +1052,21 @@ /* Add the item */ /* FIXME: playlist_BothAddInput() can fail */ - playlist_BothAddInput( p_playlist, p_input, p_node, + PL_LOCK; + playlist_BothAddInput( p_playlist, p_input, p_node, PLAYLIST_INSERT, i_position == -1 ? PLAYLIST_END : i_position + i_item, - NULL, NULL, false ); + NULL, NULL, pl_Locked ); if( i_item == 0 && !b_enqueue ) { playlist_item_t *p_item; - p_item = playlist_ItemGetByInput( p_playlist, p_input, true ); - playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, true, NULL, p_item ); + p_item = playlist_ItemGetByInput( p_playlist, p_input, pl_Locked ); + playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, NULL, p_item ); } + PL_UNLOCK; vlc_gc_decref( p_input ); } [self playlistUpdated]; -- 2.39.2