Commit 25fe96d2 authored by Gleb Pinigin's avatar Gleb Pinigin Committed by Felix Paul Kühne

ios: fix application crash due permitted opengl calls in background (fixes #8139)

Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 4c8fafe5
...@@ -232,14 +232,17 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned requested_count) ...@@ -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) static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
{ {
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
vout_display_opengl_Prepare( sys->vgl, pic, subpicture ); vout_display_opengl_Prepare( sys->vgl, pic, subpicture );
}
} }
static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture) static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture)
{ {
vout_display_sys_t *sys = vd->sys; 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); picture_Release (pic);
sys->has_first_frame = true; sys->has_first_frame = true;
(void)subpicture; (void)subpicture;
...@@ -297,7 +300,10 @@ static void OpenglSwap(vlc_gl_t *gl) ...@@ -297,7 +300,10 @@ static void OpenglSwap(vlc_gl_t *gl)
{ {
vout_display_sys_t *sys = gl->sys; vout_display_sys_t *sys = gl->sys;
EAGLContext *context = [sys->glView context]; EAGLContext *context = [sys->glView context];
[context presentRenderbuffer:GL_RENDERBUFFER];
if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
[context presentRenderbuffer:GL_RENDERBUFFER];
}
} }
/***************************************************************************** /*****************************************************************************
......
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