vlc/vlc-3.0 | branch: master | Marvin Scholz <[email protected]> | Sat Jan 19 15:11:15 2019 +0100| [5a1e191b8a691228761b481aa5568d52d57bb3a1] | committer: Felix Paul Kühne
vout/ios: Fix crash due to unexpected _eaglEnabled state Fix videolan/VLCKit#221 Signed-off-by: Thomas Guillem <[email protected]> (cherry picked from commit 4d5f4b1ccbd7698ea672ac8d10183f6ed67a1e0d) > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=5a1e191b8a691228761b481aa5568d52d57bb3a1 --- modules/video_output/ios.m | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m index 2d14cc0880..26f84667ea 100644 --- a/modules/video_output/ios.m +++ b/modules/video_output/ios.m @@ -779,13 +779,15 @@ static void GLESSwap(vlc_gl_t *gl) { _appActive = NO; - if (_eaglEnabled) - { - /* Wait for the vout to unlock the eagl context before releasing - * it. */ - while (_gl_attached) - vlc_cond_wait(&_gl_attached_wait, &_mutex); - + /* Wait for the vout to unlock the eagl context before releasing + * it. */ + while (_gl_attached && _eaglEnabled) + vlc_cond_wait(&_gl_attached_wait, &_mutex); + + /* _eaglEnabled can change during the vlc_cond_wait + * as the mutex is unlocked during that, so this check + * has to be done after the vlc_cond_wait! */ + if (_eaglEnabled) { [self flushEAGLLocked]; _eaglEnabled = NO; } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
