File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
ios/IJKMediaPlayer/IJKMediaPlayer/ijkmedia/ijksdl/ios Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ - (id) initWithFrame:(CGRect)frame
8585 [self registerApplicationObservers ];
8686
8787 _didSetupGL = NO ;
88- [self setupGLOnce ];
88+ if ([self isApplicationActive ] == YES )
89+ [self setupGLOnce ];
8990 }
9091
9192 return self;
@@ -496,6 +497,7 @@ - (void)unregisterApplicationObservers
496497- (void )applicationWillEnterForeground
497498{
498499 NSLog (@" IJKSDLGLView:applicationWillEnterForeground: %d " , (int )[UIApplication sharedApplication ].applicationState );
500+ [self setupGLOnce ];
499501 _applicationState = IJKSDLGLViewApplicationForegroundState;
500502 [self toggleGLPaused: NO ];
501503}
@@ -510,13 +512,15 @@ - (void)applicationWillResignActive
510512{
511513 NSLog (@" IJKSDLGLView:applicationWillResignActive: %d " , (int )[UIApplication sharedApplication ].applicationState );
512514 [self toggleGLPaused: YES ];
515+ glFinish ();
513516}
514517
515518- (void )applicationDidEnterBackground
516519{
517520 NSLog (@" IJKSDLGLView:applicationDidEnterBackground: %d " , (int )[UIApplication sharedApplication ].applicationState );
518521 _applicationState = IJKSDLGLViewApplicationBackgroundState;
519522 [self toggleGLPaused: YES ];
523+ glFinish ();
520524}
521525
522526- (void )applicationWillTerminate
You can’t perform that action at this time.
0 commit comments