diff options
author | Akemi <der.richter@gmx.de> | 2018-07-23 11:31:01 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-09-30 17:13:34 +0300 |
commit | 44e49aee3ccd48459b9c242d296bf7056d2fcdb3 (patch) | |
tree | cfa4c2cb86a340e70c1e91be0a1bb1c8aa574f9b | |
parent | 5c2056ad0a43b1d15baef6d289aff8cacadad053 (diff) | |
download | mpv-44e49aee3ccd48459b9c242d296bf7056d2fcdb3.tar.bz2 mpv-44e49aee3ccd48459b9c242d296bf7056d2fcdb3.tar.xz |
cocoa-cb: move macOS option retrieval to the earliest point possible
moved the retrieval of the macOS specific options from the backend
initialisation to the initialisation of the CocoaCB class, the earliest
point possible. this way macOS specific options can be used for the
opengl context creation for example.
-rw-r--r-- | osdep/macOS_mpv_helper.swift | 6 | ||||
-rw-r--r-- | video/out/cocoa_cb_common.swift | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/osdep/macOS_mpv_helper.swift b/osdep/macOS_mpv_helper.swift index e1fb3cf6cb..a1bb03f508 100644 --- a/osdep/macOS_mpv_helper.swift +++ b/osdep/macOS_mpv_helper.swift @@ -45,6 +45,12 @@ class MPVHelper: NSObject { mpctx = UnsafeMutablePointer<MPContext>(mp_client_get_core(mpvHandle)) inputContext = mpctx!.pointee.input + if let app = NSApp as? Application { + let ptr = mp_get_config_group(mpctx!, mp_client_get_global(mpvHandle), + app.getMacOSConf()) + macOpts = UnsafeMutablePointer<macos_opts>(OpaquePointer(ptr))!.pointee + } + mpv_observe_property(mpvHandle, 0, "ontop", MPV_FORMAT_FLAG) mpv_observe_property(mpvHandle, 0, "border", MPV_FORMAT_FLAG) mpv_observe_property(mpvHandle, 0, "keepaspect-window", MPV_FORMAT_FLAG) diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift index 1865cc9b5c..790a07deb8 100644 --- a/video/out/cocoa_cb_common.swift +++ b/video/out/cocoa_cb_common.swift @@ -61,12 +61,6 @@ class CocoaCB: NSObject { if backendState == .uninitialized { backendState = .needsInit - if let app = NSApp as? Application { - let ptr = mp_get_config_group(mpv.mpctx!, vo.pointee.global, - app.getMacOSConf()) - mpv.macOpts = UnsafeMutablePointer<macos_opts>(OpaquePointer(ptr))!.pointee - } - view = EventsView(cocoaCB: self) view.layer = layer view.wantsLayer = true |