summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2024-03-23 22:07:06 +0100
committerder richter <der.richter@gmx.de>2024-03-24 23:03:48 +0100
commit2a4bf7ca22e0513d7ad0f9072e1877d891e182ac (patch)
tree5eb2d3430df16dfc7650f29732d06ca380ec4bc7 /video/out
parent7e07e1a087e4107914294c5e9717f798e446c5d9 (diff)
downloadmpv-2a4bf7ca22e0513d7ad0f9072e1877d891e182ac.tar.bz2
mpv-2a4bf7ca22e0513d7ad0f9072e1877d891e182ac.tar.xz
cocoa-cb: use a separate mpv_handle for cocoa-cb to simplify shutdown
Diffstat (limited to 'video/out')
-rw-r--r--video/out/cocoa_cb_common.swift9
1 files changed, 4 insertions, 5 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index bd4ac44727..7ac0f35096 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -21,7 +21,7 @@ class CocoaCB: Common {
var libmpv: LibmpvHelper
var layer: GLLayer?
- @objc var isShuttingDown: Bool = false
+ var isShuttingDown: Bool = false
enum State {
case uninitialized
@@ -199,7 +199,7 @@ class CocoaCB: Common {
return super.control(vo, events: events, request: request, data: data)
}
- func shutdown(_ destroy: Bool = false) {
+ func shutdown() {
isShuttingDown = window?.isAnimating ?? false ||
window?.isInFullscreen ?? false && option.vo.native_fs
if window?.isInFullscreen ?? false && !(window?.isAnimating ?? false) {
@@ -211,14 +211,13 @@ class CocoaCB: Common {
uninitCommon()
layer?.lockCglContext()
- libmpv.deinitRender()
+ libmpv.uninit()
layer?.unlockCglContext()
- libmpv.deinitMPV(destroy)
}
func checkShutdown() {
if isShuttingDown {
- shutdown(true)
+ shutdown()
}
}