diff options
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/cocoa_cb_common.swift | 5 | ||||
-rw-r--r-- | video/out/mac/common.swift | 5 | ||||
-rw-r--r-- | video/out/mac_common.swift | 5 |
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() |