]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/applescript.m
Use pl_Locked and pl_Unlocked.
[vlc] / modules / gui / macosx / applescript.m
index f64340e536d273611d556a6be40d953786fa5581..cfba3bb341d922fd75935874d088d68b5321d9b1 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * applescript.m: MacOS X AppleScript support
  *****************************************************************************
- * Copyright (C) 2002-2003, 2005, 2007 the VideoLAN team
+ * Copyright (C) 2002-2003, 2005, 2007-2008 the VideoLAN team
  * $Id$
  *
  * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
@@ -41,8 +41,7 @@
     if ( [o_command isEqualToString:@"GetURL"] || [o_command isEqualToString:@"OpenURL"] )
     {
         intf_thread_t * p_intf = VLCIntf;
-        playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                                        FIND_ANYWHERE );
+        playlist_t * p_playlist = pl_Yield( p_intf );
         if( p_playlist == NULL )
         {
             return nil;
@@ -59,8 +58,9 @@
                                     displayNameAtPath: o_urlString] UTF8String] );
             /* FIXME: playlist_AddInput() can fail */
             playlist_AddInput( p_playlist, p_input, PLAYLIST_INSERT,
-                               PLAYLIST_END, VLC_TRUE, VLC_FALSE );
+                               PLAYLIST_END, true, pl_Unlocked );
 
+            vlc_gc_decref( p_input );
 
             o_url = [NSURL fileURLWithPath: o_urlString];
             if( o_url != nil )
@@ -90,8 +90,7 @@
     NSString *o_command = [[self commandDescription] commandName];
 
     intf_thread_t * p_intf = VLCIntf;
-    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                                    FIND_ANYWHERE );
+    playlist_t * p_playlist = pl_Yield( p_intf );
     if( p_playlist == NULL )
     {
         return nil;