summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2024-03-19 21:36:07 +0100
committerder richter <der.richter@gmx.de>2024-03-21 18:33:15 +0100
commit6defd49aa1f1d7b8a4d536c2a9fbf856dcf541db (patch)
treec00c8a69e190c1cd6026e5a900d13bc1a9c4e854 /video/out
parent90c534a8213a84c78f54d093c429d65b0c80a811 (diff)
downloadmpv-6defd49aa1f1d7b8a4d536c2a9fbf856dcf541db.tar.bz2
mpv-6defd49aa1f1d7b8a4d536c2a9fbf856dcf541db.tar.xz
mac/option: make option helper vo struct independent
Diffstat (limited to 'video/out')
-rw-r--r--video/out/cocoa_cb_common.swift5
-rw-r--r--video/out/mac/common.swift5
-rw-r--r--video/out/mac_common.swift5
3 files changed, 9 insertions, 6 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index 624f2bec4b..b482499646 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -35,11 +35,12 @@ class CocoaCB: Common {
let newlog = mp_log_new(UnsafeMutablePointer<MPContext>(mpvHandle), mp_client_get_log(mpvHandle), "cocoacb")
libmpv = LibmpvHelper(mpvHandle, newlog)
super.init(newlog)
+ option = OptionHelper(UnsafeMutablePointer(mpvHandle), mp_client_get_global(mpvHandle))
layer = GLLayer(cocoaCB: self)
}
func preinit(_ vo: UnsafeMutablePointer<vo>) {
- option = OptionHelper(vo)
+ self.vo = vo
input = InputHelper(vo.pointee.input_ctx, option)
if backendState == .uninitialized {
@@ -62,7 +63,7 @@ class CocoaCB: Common {
}
func reconfig(_ vo: UnsafeMutablePointer<vo>) {
- option?.vo = vo
+ self.vo = vo
if backendState == .needsInit {
DispatchQueue.main.sync { self.initBackend(vo) }
} else if option?.opts.auto_window_resize ?? true {
diff --git a/video/out/mac/common.swift b/video/out/mac/common.swift
index be1e628801..7fcc4b607a 100644
--- a/video/out/mac/common.swift
+++ b/video/out/mac/common.swift
@@ -22,6 +22,7 @@ class Common: NSObject {
var option: OptionHelper?
var input: InputHelper?
var log: LogHelper
+ var vo: UnsafeMutablePointer<vo>?
let queue: DispatchQueue = DispatchQueue(label: "io.mpv.queue")
@objc var window: Window?
@@ -483,11 +484,11 @@ class Common: NSObject {
events |= ev
eventsLock.unlock()
- guard let vout = option?.vo else {
+ guard let vo = vo else {
log.sendWarning("vo nil in flagEvents")
return
}
- vo_wakeup(vout)
+ vo_wakeup(vo)
}
func checkEvents() -> Int {
diff --git a/video/out/mac_common.swift b/video/out/mac_common.swift
index 41bed0c4f4..364cd59319 100644
--- a/video/out/mac_common.swift
+++ b/video/out/mac_common.swift
@@ -27,7 +27,8 @@ class MacCommon: Common {
@objc init(_ vo: UnsafeMutablePointer<vo>) {
let newlog = mp_log_new(vo, vo.pointee.log, "mac")
super.init(newlog)
- option = OptionHelper(vo)
+ self.vo = vo
+ option = OptionHelper(vo, vo.pointee.global)
input = InputHelper(vo.pointee.input_ctx, option)
timer = PreciseTimer(common: self)
@@ -38,7 +39,7 @@ class MacCommon: Common {
}
@objc func config(_ vo: UnsafeMutablePointer<vo>) -> Bool {
- option?.vo = vo
+ self.vo = vo
DispatchQueue.main.sync {
let previousActiveApp = getActiveApp()