diff options
author | der richter <der.richter@gmx.de> | 2023-11-09 18:57:41 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-09 18:12:25 +0000 |
commit | 23de1deaaaace05bb9504567a852ac66e76a1ad1 (patch) | |
tree | 34569c067e22eaf0a6464ca3af0c412f394073ed /video/out/mac/common.swift | |
parent | a5bf211e128b4fb916edcf5f46bd23d3ff222711 (diff) | |
download | mpv-23de1deaaaace05bb9504567a852ac66e76a1ad1.tar.bz2 mpv-23de1deaaaace05bb9504567a852ac66e76a1ad1.tar.xz |
mac: remove runtime checks and compatibility for macOS older than 10.15
we stopped supporting macOS older than 10.15 and hence can remove all
the unnecessary runtime checks and compatibility layers.
Diffstat (limited to 'video/out/mac/common.swift')
-rw-r--r-- | video/out/mac/common.swift | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/video/out/mac/common.swift b/video/out/mac/common.swift index feb354261c..6da99ca20b 100644 --- a/video/out/mac/common.swift +++ b/video/out/mac/common.swift @@ -164,17 +164,6 @@ class Common: NSObject { view?.removeFromSuperview() } - let linkCallback: CVDisplayLinkOutputCallback = { - (displayLink: CVDisplayLink, - inNow: UnsafePointer<CVTimeStamp>, - inOutputTime: UnsafePointer<CVTimeStamp>, - flagsIn: CVOptionFlags, - flagsOut: UnsafeMutablePointer<CVOptionFlags>, - displayLinkContext: UnsafeMutableRawPointer?) -> CVReturn in - let com = unsafeBitCast(displayLinkContext, to: Common.self) - return com.displayLinkCallback(displayLink, inNow, inOutputTime, flagsIn, flagsOut) - } - func displayLinkCallback(_ displayLink: CVDisplayLink, _ inNow: UnsafePointer<CVTimeStamp>, _ inOutputTime: UnsafePointer<CVTimeStamp>, @@ -195,12 +184,8 @@ class Common: NSObject { } CVDisplayLinkSetCurrentCGDisplay(link, screen.displayID) - if #available(macOS 10.12, *) { - CVDisplayLinkSetOutputHandler(link) { link, now, out, inFlags, outFlags -> CVReturn in - return self.displayLinkCallback(link, now, out, inFlags, outFlags) - } - } else { - CVDisplayLinkSetOutputCallback(link, linkCallback, MPVHelper.bridge(obj: self)) + CVDisplayLinkSetOutputHandler(link) { link, now, out, inFlags, outFlags -> CVReturn in + return self.displayLinkCallback(link, now, out, inFlags, outFlags) } CVDisplayLinkStart(link) } |