Commit c447a896 authored by Thomas Guillem's avatar Thomas Guillem

vout: ios: init observer from constructor

This fixes a possible inconsistent state of the _appActive boolean if the apps
goes to background during the vout Open callback.
parent 3aceca60
......@@ -224,15 +224,6 @@ static int Open(vlc_object_t *this)
vd->display = PictureDisplay;
vd->control = Control;
/* */
[[NSNotificationCenter defaultCenter] addObserver:sys->glESView
selector:@selector(applicationStateChanged:)
name:UIApplicationWillResignActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:sys->glESView
selector:@selector(applicationStateChanged:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
return VLC_SUCCESS;
bailout:
......@@ -445,6 +436,15 @@ static void GLESSwap(vlc_gl_t *gl)
return nil;
}
/* */
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationStateChanged:)
name:UIApplicationWillResignActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationStateChanged:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
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