From 3f6be8335001faac76789691f5b63e3a869d9e53 Mon Sep 17 00:00:00 2001 From: Akemi Date: Sat, 17 Nov 2018 13:12:01 +0100 Subject: cocoa-cb: synchronise the flush with the render this could lead to a crash on deinit when flush was called while the opengl state was cleaned up. Fixes #6323 --- video/out/cocoa-cb/video_layer.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'video') diff --git a/video/out/cocoa-cb/video_layer.swift b/video/out/cocoa-cb/video_layer.swift index ccc84f8fa8..69a9620409 100644 --- a/video/out/cocoa-cb/video_layer.swift +++ b/video/out/cocoa-cb/video_layer.swift @@ -110,8 +110,7 @@ class VideoLayer: CAOpenGLLayer { } updateSurfaceSize() - mpv.drawRender(surfaceSize!) - CGLFlushDrawable(ctx) + mpv.drawRender(surfaceSize!, ctx) if needsICCUpdate { needsICCUpdate = false @@ -244,7 +243,7 @@ class VideoLayer: CAOpenGLLayer { if isUpdate && needsFlip { CGLSetCurrentContext(cglContext!) if mpv.isRenderUpdateFrame() { - mpv.drawRender(NSZeroSize, skip: true) + mpv.drawRender(NSZeroSize, cglContext!, skip: true) } } displayLock.unlock() -- cgit v1.2.3