[vlc-commits] macosx: prevent AppKit calls from threads which aren't the main thread ( fixes #5779

Felix Paul Kühne git at videolan.org
Tue Jan 31 22:17:42 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jan 31 15:20:40 2012 +0100| [8c6f1380248811d620a37315a24a3080b1a848a4] | committer: Jean-Baptiste Kempf

macosx: prevent AppKit calls from threads which aren't the main thread (fixes #5779
(cherry picked from commit 861c0e2c81032594ac05e0f36b1b1e4d5f535ab6)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=8c6f1380248811d620a37315a24a3080b1a848a4
---

 modules/gui/macosx/intf.m |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index b9afbf1..7d906dc 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -249,13 +249,13 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
     NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
     switch (new_val.i_int) {
         case INPUT_EVENT_STATE:
-            [[VLCMain sharedInstance] playbackStatusUpdated];
+            [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(playbackStatusUpdated) withObject: nil waitUntilDone:NO];
             break;
         case INPUT_EVENT_RATE:
             [[[VLCMain sharedInstance] mainMenu] performSelectorOnMainThread:@selector(updatePlaybackRate) withObject: nil waitUntilDone:NO];
             break;
         case INPUT_EVENT_POSITION:
-            [[VLCMain sharedInstance] updatePlaybackPosition];
+            [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updatePlaybackPosition) withObject: nil waitUntilDone:NO];
             break;
         case INPUT_EVENT_TITLE:
         case INPUT_EVENT_CHAPTER:
@@ -296,22 +296,22 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
 
         case INPUT_EVENT_ITEM_NAME:
             [[VLCMain sharedInstance] updateName];
-            [[VLCMain sharedInstance] playlistUpdated];
+            [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(playlistUpdated) withObject: nil waitUntilDone:NO];
             break;
 
         case INPUT_EVENT_AUDIO_DELAY:
         case INPUT_EVENT_SUBTITLE_DELAY:
-            [[VLCMain sharedInstance] updateDelays];
+            [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateDelays) withObject:nil waitUntilDone:NO];
             break;
 
         case INPUT_EVENT_DEAD:
             [[VLCMain sharedInstance] updateName];
-            [[VLCMain sharedInstance] updatePlaybackPosition];
+            [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updatePlaybackPosition) withObject:nil waitUntilDone:NO];
             break;
 
         case INPUT_EVENT_ABORT:
             [[VLCMain sharedInstance] updateName];
-            [[VLCMain sharedInstance] updatePlaybackPosition];
+            [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updatePlaybackPosition) withObject:nil waitUntilDone:NO];
             break;
 
         default:



More information about the vlc-commits mailing list