[vlc-devel] commit: macosx: added missing playlist locks ( Felix Paul Kühne )

git version control git at videolan.org
Thu Feb 19 15:37:34 CET 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Feb 18 10:55:32 2009 +0100| [0bd6fe5f997142bfaa6f24244d966fd9d040faf2] | committer: Felix Paul Kühne 

macosx: added missing playlist locks

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

 modules/gui/macosx/intf.m     |    6 ++++++
 modules/gui/macosx/playlist.m |    4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 2ac52a1..9b64436 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1544,7 +1544,11 @@ static void * manage_cleanup( void * args )
             /* update our info-panel to reflect the new item, if we don't show
              * the playlist or the selection is empty */
             if( [self isPlaylistCollapsed] == YES )
+            {
+                PL_LOCK;
                 [[self getInfo] updatePanelWithItem: playlist_CurrentPlayingItem( p_playlist )->p_input];
+                PL_UNLOCK;
+            }
 
             /* seekable streams */
             b_seekable = var_GetBool( p_input, "can-seek" );
@@ -1836,11 +1840,13 @@ end:
     if( p_input && vlc_object_alive (p_input) )
     {
         NSString *o_temp;
+        PL_LOCK;
         playlist_item_t * p_item = playlist_CurrentPlayingItem( p_playlist );
         if( input_item_GetNowPlaying( p_item->p_input ) )
             o_temp = [NSString stringWithUTF8String:input_item_GetNowPlaying( p_item->p_input )];
         else
             o_temp = [NSString stringWithUTF8String:p_item->p_input->psz_name];
+        PL_UNLOCK;
         [self setScrollField: o_temp stopAfter:-1];
         [[[self getControls] getFSPanel] setStreamTitle: o_temp];
         vlc_object_release( p_input );
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 14018c6..334edfe 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -573,7 +573,9 @@
     playlist_item_t *p_item, *p_temp_item;
     NSMutableArray *o_array = [NSMutableArray array];
 
+    PL_LOCK;
     p_item = playlist_CurrentPlayingItem( p_playlist );
+    PL_UNLOCK;
     if( p_item == NULL )
     {
         pl_Release( VLCIntf );
@@ -1416,8 +1418,10 @@
 
     id o_playing_item;
 
+    PL_LOCK;
     o_playing_item = [o_outline_dict objectForKey:
                 [NSString stringWithFormat:@"%p",  playlist_CurrentPlayingItem( p_playlist )]];
+    PL_UNLOCK;
 
     if( [self isItem: [o_playing_item pointerValue] inNode:
                         [item pointerValue] checkItemExistence: YES]




More information about the vlc-devel mailing list