From 7281f92e7210fb48f8b34c1bbb8f037808a73868 Mon Sep 17 00:00:00 2001 From: Gustavo Garcia Date: Tue, 7 Nov 2017 17:54:03 +0100 Subject: [PATCH] Fix do not initialize OpenGL if VideoView is creating with the app in background Bug: webrtc:8498 Change-Id: I354caf9c2b4dc9e596e97cd9a80dac71b6c89289 Reviewed-on: https://webrtc-review.googlesource.com/20980 Reviewed-by: Magnus Jedvert Commit-Queue: Magnus Jedvert Cr-Commit-Position: refs/heads/master@{#20611} --- sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m b/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m index 80282f0b0b..53f5270884 100644 --- a/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m +++ b/sdk/objc/Framework/Classes/UI/RTCEAGLVideoView.m @@ -183,7 +183,9 @@ RTCEAGLVideoView *strongSelf = weakSelf; [strongSelf displayLinkTimerDidFire]; }]; - [self setupGL]; + if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive) { + [self setupGL]; + } return YES; }