Commit d83976cd authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed crash when setting up the video output

AppKit could be accessed by a non-main-thread

This is a manual backport of 9dd2f6ed
parent 669e67ba
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
- (void)drawFancyGradientEffectForTimeSlider; - (void)drawFancyGradientEffectForTimeSlider;
- (id)videoView; - (id)videoView;
- (id)setupVideoView; - (void)setupVideoView;
- (void)setVideoplayEnabled; - (void)setVideoplayEnabled;
- (void)resizeWindow; - (void)resizeWindow;
- (void)setNativeVideoSize:(NSSize)size; - (void)setNativeVideoSize:(NSSize)size;
......
...@@ -1568,7 +1568,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1568,7 +1568,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
return o_video_view; return o_video_view;
} }
- (id)setupVideoView - (void)setupVideoView
{ {
vout_thread_t *p_vout = getVout(); vout_thread_t *p_vout = getVout();
if ((var_InheritBool( VLCIntf, "embedded-video" ) || b_nativeFullscreenMode) && b_video_deco) if ((var_InheritBool( VLCIntf, "embedded-video" ) || b_nativeFullscreenMode) && b_video_deco)
...@@ -1619,7 +1619,6 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1619,7 +1619,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[o_video_view window] setLevel: NSNormalWindowLevel]; [[o_video_view window] setLevel: NSNormalWindowLevel];
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
return o_video_view;
} }
- (void)setVideoplayEnabled - (void)setVideoplayEnabled
......
...@@ -1769,7 +1769,8 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1769,7 +1769,8 @@ unsigned int CocoaKeyToVLC( unichar i_key )
- (id)getVideoViewAtPositionX: (int *)pi_x Y: (int *)pi_y withWidth: (unsigned int*)pi_width andHeight: (unsigned int*)pi_height - (id)getVideoViewAtPositionX: (int *)pi_x Y: (int *)pi_y withWidth: (unsigned int*)pi_width andHeight: (unsigned int*)pi_height
{ {
id videoView = [o_mainwindow setupVideoView]; [o_mainwindow performSelectorOnMainThread:@selector(setupVideoView) withObject:nil waitUntilDone:YES];
id videoView = [o_mainwindow videoView];
NSRect videoRect = [videoView frame]; NSRect videoRect = [videoView frame];
int i_x = (int)videoRect.origin.x; int i_x = (int)videoRect.origin.x;
int i_y = (int)videoRect.origin.y; int i_y = (int)videoRect.origin.y;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment