Skip to content
Snippets Groups Projects
Commit c4a8e8a0 authored by Claudio Cambra's avatar Claudio Cambra Committed by Steve Lhomme
Browse files

macosx: Fix crashing when using the library window due to bad calls to setNativeVideoSize


Signed-off-by: default avatarClaudio Cambra <developer@claudiocambra.com>
parent 4dd7d678
No related branches found
No related tags found
1 merge request!3224macosx: Make library window freely resizeable
Pipeline #310781 passed with stages
in 30 minutes and 19 seconds
......@@ -348,6 +348,10 @@ int WindowOpen(vlc_window_t *p_wnd)
if (!isEmbedded) {
[self setupWindowOriginForVideoWindow:videoWindow
atPosition:videoViewPosition];
if ([videoWindow isKindOfClass:[VLCAspectRatioRetainingVideoWindow class]]) {
[(VLCAspectRatioRetainingVideoWindow*)videoWindow setNativeVideoSize:videoViewSize];
}
}
// cascade windows if we have more than one vout
......@@ -355,8 +359,6 @@ int WindowOpen(vlc_window_t *p_wnd)
[self cascadeVoutWindowsForVideoWindow:videoWindow];
}
// resize window if it is an aspect ratio retaining window
[(VLCAspectRatioRetainingVideoWindow*)videoWindow setNativeVideoSize:videoViewSize];
[videoWindow makeKeyAndOrderFront: self];
}
......@@ -470,13 +472,15 @@ int WindowOpen(vlc_window_t *p_wnd)
- (void)setNativeVideoSize:(NSSize)size forWindow:(vlc_window_t *)p_wnd
{
VLCAspectRatioRetainingVideoWindow *o_window = [_voutWindows objectForKey:[NSValue valueWithPointer:p_wnd]];
VLCVideoWindowCommon *o_window = [_voutWindows objectForKey:[NSValue valueWithPointer:p_wnd]];
if (!o_window) {
msg_Err(getIntf(), "Cannot set size for nonexisting window");
return;
} else if (![o_window isKindOfClass:[VLCAspectRatioRetainingVideoWindow class]]) {
return;
}
[o_window setNativeVideoSize:size];
[(VLCAspectRatioRetainingVideoWindow*)o_window setNativeVideoSize:size];
}
- (void)setWindowLevel:(NSInteger)i_level forWindow:(vlc_window_t *)p_wnd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment