]> git.sesse.net Git - vlc/commitdiff
* When choosing a autogenerated menuitem, we now create a new thread to
authorDerk-Jan Hartman <hartman@videolan.org>
Tue, 3 Jun 2003 22:21:46 +0000 (22:21 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Tue, 3 Jun 2003 22:21:46 +0000 (22:21 +0000)
  do the actual execution of this command. this is a (very ugly) workaround
  to the problem we were having with the deinterlace menu on osx.

  It works now, but now i'm running into the black screen and continous
  "late picture skipped (-218000)" again which is also plagueing us when you
  enter fullscreen with a filter enabled. This ought to be fixed before 0.6.0
  as well.

modules/gui/macosx/controls.h
modules/gui/macosx/controls.m

index b2eb9a5e34d89fcf4842a8f8e3e8ff28d92838a6..fa4e0fcd64404c30cf586538983aee9cec107fb9 100644 (file)
@@ -2,7 +2,7 @@
  * controls.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.h,v 1.5 2003/06/01 23:48:17 hartman Exp $
+ * $Id: controls.h,v 1.6 2003/06/03 22:21:46 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -64,6 +64,7 @@
                     var:(const char *)psz_variable
                     selector:(SEL)pf_callback;
 - (IBAction)toggleVar:(id)sender;
+- (int)toggleVarThread:(id)_o_data;
 
 @end
 
index c5ef187e8456861171f73f53d287d3cb72f4ce18..383bcec2803a355d9302e4dedc4175f55596d92d 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.40 2003/06/01 23:48:17 hartman Exp $
+ * $Id: controls.m,v 1.41 2003/06/03 22:21:46 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
 {
     NSMenuItem *o_mi = (NSMenuItem *)sender;
     VLCMenuExt *o_data = [[o_mi representedObject] pointerValue];
+    [NSThread detachNewThreadSelector: @selector(toggleVarThread:)
+        toTarget: self withObject: o_data];
+
+    return;
+}
+
+- (int)toggleVarThread: (id)_o_data
+{
     vlc_object_t *p_object;
+    NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
+    VLCMenuExt *o_data = (VLCMenuExt *)_o_data;
+
+    vlc_thread_set_priority( [NSApp getIntf] , VLC_THREAD_PRIORITY_LOW );
 
     p_object = (vlc_object_t *)vlc_object_get( [NSApp getIntf],
                                     [o_data objectID] );
-    if( p_object == NULL ) return;
 
-    var_Set( p_object, strdup([o_data name]), [o_data value] );
-    vlc_object_release( p_object );
-    
-    return;
+    if( p_object != NULL )
+    {
+        var_Set( p_object, strdup([o_data name]), [o_data value] );
+        vlc_object_release( p_object );
+        [o_pool release];
+        return VLC_TRUE;
+    }
+    [o_pool release];
+    return VLC_EGENERIC;
 }
 
 @end