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

caopengllayer: drop legacy NSAutoreleasePool pattern

parent b8b5a70c
......@@ -114,8 +114,7 @@ static int Open (vlc_object_t *p_this)
if (sys == NULL)
return VLC_EGENERIC;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@autoreleasepool {
id container = var_CreateGetAddress(vd, "drawable-nsobject");
if (container)
vout_display_DeleteWindow(vd, NULL);
......@@ -137,12 +136,15 @@ static int Open (vlc_object_t *p_this)
sys->cgLayer = [[VLCCAOpenGLLayer alloc] init];
[sys->cgLayer setVoutDisplay:vd];
[sys->cgLayer performSelectorOnMainThread:@selector(display) withObject:nil waitUntilDone:YES];
[sys->cgLayer performSelectorOnMainThread:@selector(display)
withObject:nil
waitUntilDone:YES];
if ([container respondsToSelector:@selector(addVoutLayer:)]) {
msg_Dbg(vd, "container implements implicit protocol");
[container addVoutLayer:sys->cgLayer];
} else if ([container respondsToSelector:@selector(addSublayer:)] || [container isKindOfClass:[CALayer class]]) {
} else if ([container respondsToSelector:@selector(addSublayer:)] ||
[container isKindOfClass:[CALayer class]]) {
msg_Dbg(vd, "container doesn't implement implicit protocol, fallback mode used");
[container addSublayer:sys->cgLayer];
} else {
......@@ -196,13 +198,12 @@ static int Open (vlc_object_t *p_this)
vout_display_SendEventFullscreen(vd, false);
vout_display_SendEventDisplaySize(vd, (int)outputSize.width, (int)outputSize.height);
[pool release];
return VLC_SUCCESS;
bailout:
[pool release];
bailout:
Close(p_this);
return VLC_EGENERIC;
}
}
static void Close (vlc_object_t *p_this)
......
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