summaryrefslogtreecommitdiffstats
path: root/osdep/macos/mpv_helper.swift
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/macos/mpv_helper.swift')
-rw-r--r--osdep/macos/mpv_helper.swift12
1 files changed, 5 insertions, 7 deletions
diff --git a/osdep/macos/mpv_helper.swift b/osdep/macos/mpv_helper.swift
index d01694d736..8a05f26cb1 100644
--- a/osdep/macos/mpv_helper.swift
+++ b/osdep/macos/mpv_helper.swift
@@ -17,8 +17,8 @@
import Cocoa
-class MPVHelper: LogHelper {
-
+class MPVHelper {
+ var log: LogHelper
var vo: UnsafeMutablePointer<vo>
var optsCachePtr: UnsafeMutablePointer<m_config_cache>
var optsPtr: UnsafeMutablePointer<mp_vo_opts>
@@ -33,22 +33,20 @@ class MPVHelper: LogHelper {
var input: OpaquePointer { get { return vout.input_ctx } }
var macOpts: macos_opts = macos_opts()
- init(_ vo: UnsafeMutablePointer<vo>, _ name: String) {
+ init(_ vo: UnsafeMutablePointer<vo>, _ log: LogHelper) {
self.vo = vo
+ self.log = log
guard let app = NSApp as? Application,
let cache = m_config_cache_alloc(vo, vo.pointee.global, app.getVoSubConf()) else
{
- print("NSApp couldn't be retrieved")
+ log.sendError("NSApp couldn't be retrieved")
exit(1)
}
- let newlog = mp_log_new(vo, vo.pointee.log, name)
optsCachePtr = cache
optsPtr = UnsafeMutablePointer<mp_vo_opts>(OpaquePointer(cache.pointee.opts))
- super.init(newlog)
-
guard let ptr = mp_get_config_group(vo,
vo.pointee.global,
app.getMacOSConf()) else