summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-02-17 01:12:05 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-17 23:03:45 -0800
commit4a579ad16694da158c641514b39a1547fe6c7449 (patch)
treee4eb99f5521fe39c55cf9fb8b3f93ebdb514f331
parentb67d2ede67a72d999d5afe4e4def802cf047fc4d (diff)
downloadmpv-4a579ad16694da158c641514b39a1547fe6c7449.tar.bz2
mpv-4a579ad16694da158c641514b39a1547fe6c7449.tar.xz
cocoa-cb: fix hwdec when drawing off-screen
drawing off-screen failed because we didn't have a valid context. the problem is we force off-screen drawing because the CAOpenGLLayer refuses to draw anything while being off-screen. set the current context before starting to draw anything off-screen. Fixes #5530
-rw-r--r--video/out/cocoa-cb/video_layer.swift1
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/cocoa-cb/video_layer.swift b/video/out/cocoa-cb/video_layer.swift
index 05f0894159..ed259d04f5 100644
--- a/video/out/cocoa-cb/video_layer.swift
+++ b/video/out/cocoa-cb/video_layer.swift
@@ -198,6 +198,7 @@ class VideoLayer: CAOpenGLLayer {
if !cocoaCB.window.occlusionState.contains(.visible) &&
neededFlips > 1 && canDrawOffScreen
{
+ CGLSetCurrentContext(cglContext!)
draw(cglContext!)
display()
} else {