mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:12:25 +00:00
mac/apphub: only instantiate log and option when in Application mode
when in libmpv mode there is no need to for logging and reading options. this also prevents possible race conditions with the usage and deinit of the mpv_handler.
This commit is contained in:
parent
67c48ed922
commit
9c0fc83f45
@ -50,11 +50,13 @@ class AppHub: NSObject {
|
||||
}
|
||||
|
||||
@objc func initMpv(_ mpv: OpaquePointer) {
|
||||
log.log = mp_log_new(UnsafeMutablePointer(mpv), mp_client_get_log(mpv), "app")
|
||||
option = OptionHelper(UnsafeMutablePointer(mpv), mp_client_get_global(mpv))
|
||||
input.option = option
|
||||
event = EventHelper(self, mpv)
|
||||
self.mpv = event?.mpv
|
||||
if let mpv = event?.mpv {
|
||||
self.mpv = mpv
|
||||
log.log = mp_log_new(UnsafeMutablePointer(mpv), mp_client_get_log(mpv), "app")
|
||||
option = OptionHelper(UnsafeMutablePointer(mpv), mp_client_get_global(mpv))
|
||||
input.option = option
|
||||
}
|
||||
|
||||
#if HAVE_MACOS_MEDIA_PLAYER
|
||||
remote?.registerEvents()
|
||||
|
Loading…
Reference in New Issue
Block a user