Browse Source

VLCOpenGLES2VideoView: remove EAGL context in close

Fix a crash where the destructor of the VLCOpenGLES2VideoView
(.cxx_destruct) is calling the destructor of the EAGL context, which
leads into unknown stacktraces in the EAGLContext_setDebugLabel symbol.

The setup of the crash needs using CVPixelBuffer backed by an IOSurface,
so typically a filter using the VLCCVOpenGLProvider offscreen OpenGL
implementation, which seems to imply some live-binding is still in use
if we don't close the context soon enough.
pull/141/head
Alexandre Janniaux 4 years ago
committed by Jean-Baptiste Kempf
parent
commit
f9fc7d64d3
  1. 5
      modules/video_output/apple/VLCOpenGLES2VideoView.m

5
modules/video_output/apple/VLCOpenGLES2VideoView.m

@ -290,6 +290,11 @@ static void Close(vlc_gl_t *gl)
_eaglEnabled = NO;
vlc_mutex_unlock(&_mutex);
/* We can drop the context as fast as possible since we don't use it
* anymore. It avoids crashes with the context modifying destroyed
* resources when it is being deallocated in the main thread. */
_eaglContext = nil;
/* This cannot be a synchronous dispatch because player is usually running
* in the main thread and block the main thread unless we accept our fate
* and exit here. */

Loading…
Cancel
Save