History

mac/libmpv: remove mac option handling in favour of option handler

since the option handler is not optional anymore and available on init in cocoa-cb we don't need to duplicate this functionality in libmpv anymore.

der richter committed 2 years ago

Commit f72dfd41 parent b480daa2 files · +4 −18Browse files

Unified · Split

2 files
  1. osdep/mac/libmpv_helper.swift +0 −14
  2. video/out/mac/gl_layer.swift +4 −4
osdep/mac/libmpv_helper.swift+0−14
@@ -25,23 +25,12 @@ class LibmpvHelper { · 24 unmodified lines
2525 var log: LogHelper
2626 var mpvHandle: OpaquePointer?
2727 var mpvRenderContext: OpaquePointer?
28− var macOptsPtr: UnsafeMutableRawPointer?
29− var macOpts: macos_opts = macos_opts()
3028 var fbo: GLint = 1
3129 let deinitLock = NSLock()
3230
3331 init(_ mpv: OpaquePointer, _ mpLog: OpaquePointer?) {
3432 mpvHandle = mpv
3533 log = LogHelper(mpLog)
36−
37− let global = mp_client_get_global(mpvHandle)
38− guard let ptr = mp_get_config_group(nil, global, Application.getMacOSConf()) else
39− {
40− log.sendError("macOS config group couldn't be retrieved'")
41− exit(1)
42− }
43− macOptsPtr = ptr
44− macOpts = UnsafeMutablePointer<macos_opts>(OpaquePointer(ptr)).pointee
4534 }
4635
4736 func initRender() {
@@ -63,7 +52,6 @@ class LibmpvHelper { · 15 unmodified lines
6352 exit(1)
6453 }
6554 }
66−
6755 }
6856
6957 let getProcAddress: (@convention(c) (UnsafeMutableRawPointer?, UnsafePointer<Int8>?)
@@ -230,8 +218,6 @@ class LibmpvHelper { · 160 unmodified lines
230218 if destroy {
231219 mpv_destroy(mpvHandle)
232220 }
233− ta_free(macOptsPtr)
234− macOptsPtr = nil
235221 mpvHandle = nil
236222 }
237223 }
video/out/mac/gl_layer.swift+4−4
@@ -249,7 +249,7 @@ class GLLayer: CAOpenGLLayer { · 248 unmodified lines
249249 var pix: CGLPixelFormatObj?
250250 var depth: GLint = 8
251251 var err: CGLError = CGLError(rawValue: 0)
252− let swRender = ccb.libmpv.macOpts.cocoa_cb_sw_renderer
252+ let swRender = ccb.option.macOpts.cocoa_cb_sw_renderer
253253
254254 if swRender != 1 {
255255 (pix, depth, err) = GLLayer.findPixelFormat(ccb)
@@ -277,12 +277,12 @@ class GLLayer: CAOpenGLLayer { · 21 unmodified lines
277277 glBase.insert(CGLPixelFormatAttribute(ver.rawValue), at: 1)
278278
279279 var glFormat = [glBase]
280− if ccb.libmpv.macOpts.cocoa_cb_10bit_context {
280+ if ccb.option.macOpts.cocoa_cb_10bit_context {
281281 glFormat += [glFormat10Bit]
282282 }
283283 glFormat += glFormatOptional
284284
285− if !ccb.libmpv.macOpts.macos_force_dedicated_gpu {
285+ if !ccb.option.macOpts.macos_force_dedicated_gpu {
286286 glFormat += [glFormatAutoGPU]
287287 }
288288
@@ -308,7 +308,7 @@ class GLLayer: CAOpenGLLayer { · 19 unmodified lines
308308 ccb.log.sendWarning("Couldn't create a " +
309309 "\(software ? "software" : "hardware accelerated") " +
310310 "CGL pixel format: \(errS) (\(err.rawValue))")
311− if software == false && ccb.libmpv.macOpts.cocoa_cb_sw_renderer == -1 {
311+ if software == false && ccb.option.macOpts.cocoa_cb_sw_renderer == -1 {
312312 ccb.log.sendWarning("Falling back to software renderer")
313313 }
314314

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t