cocoa-cb: fix crash on macOS 10.10

the colorspace of the layer is only available on 10.11 and upwards.

Fixes #6041
This commit is contained in:
Akemi 2018-07-30 19:56:30 +02:00 committed by sfan5
parent 6bf0edc59c
commit 049816c145
1 changed files with 3 additions and 1 deletions

View File

@ -241,8 +241,10 @@ class CocoaCB: NSObject {
func updateICCProfile() { func updateICCProfile() {
mpv.setRenderICCProfile(window.screen!.colorSpace!) mpv.setRenderICCProfile(window.screen!.colorSpace!)
if #available(macOS 10.11, *) {
layer.colorspace = window.screen!.colorSpace!.cgColorSpace! layer.colorspace = window.screen!.colorSpace!.cgColorSpace!
} }
}
func lmuToLux(_ v: UInt64) -> Int { func lmuToLux(_ v: UInt64) -> Int {
// the polinomial approximation for apple lmu value -> lux was empirically // the polinomial approximation for apple lmu value -> lux was empirically