[vlc-commits] vout: ios: init observer from constructor
Thomas Guillem
git at videolan.org
Wed Mar 7 15:34:14 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 6 13:21:08 2018 +0100| [c447a89650a0f3216500958661f0658d10740773] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c447a89650a0f3216500958661f0658d10740773
---
modules/video_output/ios.m | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index e4cdeb0481..edc71d57f0 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -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;
}
More information about the vlc-commits
mailing list