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

vout iOS: reliability improvements

parent 18b21461
...@@ -139,7 +139,10 @@ static int Open(vlc_object_t *this) ...@@ -139,7 +139,10 @@ static int Open(vlc_object_t *this)
/* get the object we will draw into */ /* get the object we will draw into */
UIView* viewContainer = var_CreateGetAddress (vd, "drawable-nsobject"); UIView* viewContainer = var_CreateGetAddress (vd, "drawable-nsobject");
if (!viewContainer) if (unlikely(viewContainer == nil))
goto bailout;
if (unlikely(![viewContainer respondsToSelector:@selector(isKindOfClass:)]))
goto bailout; goto bailout;
if (![viewContainer isKindOfClass:[UIView class]]) if (![viewContainer isKindOfClass:[UIView class]])
...@@ -400,6 +403,11 @@ static void OpenglESSwap(vlc_gl_t *gl) ...@@ -400,6 +403,11 @@ static void OpenglESSwap(vlc_gl_t *gl)
if (!self) if (!self)
return nil; return nil;
@synchronized (self) {
_appActive = ([UIApplication sharedApplication].applicationState == UIApplicationStateActive);
if (unlikely(!_appActive))
return nil;
CAEAGLLayer * layer = (CAEAGLLayer *)self.layer; CAEAGLLayer * layer = (CAEAGLLayer *)self.layer;
layer.drawableProperties = [NSDictionary dictionaryWithObject:kEAGLColorFormatRGBA8 forKey: kEAGLDrawablePropertyColorFormat]; layer.drawableProperties = [NSDictionary dictionaryWithObject:kEAGLColorFormatRGBA8 forKey: kEAGLDrawablePropertyColorFormat];
layer.opaque = YES; layer.opaque = YES;
...@@ -412,9 +420,6 @@ static void OpenglESSwap(vlc_gl_t *gl) ...@@ -412,9 +420,6 @@ static void OpenglESSwap(vlc_gl_t *gl)
[self performSelectorOnMainThread:@selector(createBuffers) withObject:nil waitUntilDone:YES]; [self performSelectorOnMainThread:@selector(createBuffers) withObject:nil waitUntilDone:YES];
[self performSelectorOnMainThread:@selector(reshape) withObject:nil waitUntilDone:NO]; [self performSelectorOnMainThread:@selector(reshape) withObject:nil waitUntilDone:NO];
[self setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; [self setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
@synchronized (self) {
_appActive = ([UIApplication sharedApplication].applicationState == UIApplicationStateActive);
} }
return self; return self;
......
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