/* Get our main view*/
nsPool = [[NSAutoreleasePool alloc] init];
- sys->glView = [[VLCOpenGLVideoView alloc] init];
-
+
+ [VLCOpenGLVideoView performSelectorOnMainThread:@selector(getNewView:) withObject:[NSValue valueWithPointer:&sys->glView] waitUntilDone:YES];
if (!sys->glView)
goto error;
#define VLCAssertMainThread() assert([[NSThread currentThread] isMainThread])
++ (void)getNewView:(NSValue *)value
+{
+ id *ret = [value pointerValue];
+ *ret = [[self alloc] init];
+}
+
/**
* Gets called by the Open() method.
- * (Non main thread).
*/
- (id)init
{
+ VLCAssertMainThread();
+
/* Warning - this may be called on non main thread */
NSOpenGLPixelFormatAttribute attribs[] =
0
};
- NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs];
+ NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
if (!fmt)
return nil;