mac: fix build on older swift versions

this is apparently something that was added with swift 5.5, though it is
hard to find anything officially.

don't capture self in closure but explicitly access all variables by
prepending self.

Fixes #12653
This commit is contained in:
der richter 2023-11-07 22:35:19 +01:00
parent 1c98ab6239
commit 040a921964
1 changed files with 5 additions and 5 deletions

View File

@ -111,11 +111,11 @@ class MacCommon: Common {
_ flagsOut: UnsafeMutablePointer<CVOptionFlags>) -> CVReturn
{
let frameTimer = mpv?.macOpts.macos_render_timer ?? Int32(RENDER_TIMER_CALLBACK)
let signalSwap = { [self] in
swapLock.lock()
swapTime += 1
swapLock.signal()
swapLock.unlock()
let signalSwap = {
self.swapLock.lock()
self.swapTime += 1
self.swapLock.signal()
self.swapLock.unlock()
}
if frameTimer != RENDER_TIMER_SYSTEM {