[vlc-commits] macosx: Move some callback code to the main thread

David Fuhrmann git at videolan.org
Sun Oct 15 21:08:34 CEST 2017


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Oct 15 21:03:32 2017 +0200| [ada12f833b62f3aca8c742b640212b42da8ac491] | committer: David Fuhrmann

macosx: Move some callback code to the main thread

This is already fixed in vlc.git.
refs #18917

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

 modules/gui/macosx/intf.m | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index b4e057107a..4bf1dc78ff 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -404,7 +404,9 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
         case INPUT_EVENT_BOOKMARK:
             break;
         case INPUT_EVENT_RECORD:
-            [[VLCMain sharedInstance] updateRecordState: var_GetBool(p_this, "record")];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [[VLCMain sharedInstance] updateRecordState: var_GetBool(p_this, "record")];
+            });
             break;
         case INPUT_EVENT_PROGRAM:
             [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateMainMenu) withObject: nil waitUntilDone:NO];
@@ -512,8 +514,10 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 {
     NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
 
-    [[VLCCoreInteraction sharedInstance] performSelectorOnMainThread:@selector(pause) withObject:nil waitUntilDone:NO];
-    [[VLCApplication sharedApplication] hide:nil];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[VLCCoreInteraction sharedInstance] pause];
+        [[VLCApplication sharedApplication] hide:nil];
+    });
 
     [o_pool release];
     return VLC_SUCCESS;



More information about the vlc-commits mailing list