[vlc-devel] [PATCH 3/3] ios: fix application crash due permitted opengl calls in background (fixes #8139)
Gleb Pinigin
gpinigin at gmail.com
Sat Mar 23 12:31:39 CET 2013
---
modules/video_output/ios.m | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 53c8216..0f0d217 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -232,14 +232,17 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned requested_count)
static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
{
vout_display_sys_t *sys = vd->sys;
-
- vout_display_opengl_Prepare( sys->vgl, pic, subpicture );
+ if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
+ vout_display_opengl_Prepare( sys->vgl, pic, subpicture );
+ }
}
static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
{
vout_display_sys_t *sys = vd->sys;
- vout_display_opengl_Display(sys->vgl, &vd->fmt );
+ if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
+ vout_display_opengl_Display(sys->vgl, &vd->fmt );
+ }
picture_Release (pic);
sys->has_first_frame = true;
(void)subpicture;
@@ -297,7 +300,10 @@ static void OpenglSwap(vlc_gl_t *gl)
{
vout_display_sys_t *sys = gl->sys;
EAGLContext *context = [sys->glView context];
- [context presentRenderbuffer:GL_RENDERBUFFER];
+
+ if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
+ [context presentRenderbuffer:GL_RENDERBUFFER];
+ }
}
/*****************************************************************************
--
1.7.12.4 (Apple Git-37)
More information about the vlc-devel
mailing list