[vlc-devel] [PATCH 5/5] vout/ios: Fix crash due to unexpected _eaglEnabled state

Jean-Baptiste Kempf jb at videolan.org
Sat Jan 19 17:14:42 CET 2019


You are a f**king hero.

On Sat, 19 Jan 2019, at 15:11, Marvin Scholz wrote:
> Fix videolan/VLCKit#221
> ---
>  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 7c072f6c786..1a04cfabb03 100644
> --- a/modules/video_output/ios.m
> +++ b/modules/video_output/ios.m
> @@ -763,13 +763,15 @@ - (void)applicationStateChanged:(NSNotification 
> *)notification
>      {
>          _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;
>          }
> -- 
> 2.17.2 (Apple Git-113)
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list