diff options
Diffstat (limited to 'video/out/cocoa_cb_common.swift')
-rw-r--r-- | video/out/cocoa_cb_common.swift | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift index dd0738f7e3..5c312cbff0 100644 --- a/video/out/cocoa_cb_common.swift +++ b/video/out/cocoa_cb_common.swift @@ -167,17 +167,9 @@ class CocoaCB: Common { layer?.update(force: true) } - var controlCallback: mp_render_cb_control_fn = { ( v, ctx, e, request, d ) -> Int32 in + var controlCallback: mp_render_cb_control_fn = { ( v, ctx, e, request, data ) -> Int32 in let ccb = unsafeBitCast(ctx, to: CocoaCB.self) - // the data pointer can be a null pointer, the libmpv control callback - // provides nil instead of the 0 address like the usual control call of - // an internal vo, workaround to create a null pointer instead of nil - var data = UnsafeMutableRawPointer.init(bitPattern: 0).unsafelyUnwrapped - if let dunwrapped = d { - data = dunwrapped - } - guard let vo = v, let events = e else { ccb.log.sendWarning("Unexpected nil value in Control Callback") return VO_FALSE @@ -189,7 +181,7 @@ class CocoaCB: Common { override func control(_ vo: UnsafeMutablePointer<vo>, events: UnsafeMutablePointer<Int32>, request: UInt32, - data: UnsafeMutableRawPointer) -> Int32 + data: UnsafeMutableRawPointer?) -> Int32 { switch mp_voctrl(request) { case VOCTRL_PREINIT: |