mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-18 18:42:40 +00:00
Fixed not working frame pacing on macOS
This commit is contained in:
parent
bb235ab1ae
commit
1046d264d8
@ -296,6 +296,16 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_DisplayLink != nullptr) {
|
||||||
|
// Vsync is enabled, so wait for a swap before returning
|
||||||
|
SDL_LockMutex(m_VsyncMutex);
|
||||||
|
if (SDL_CondWaitTimeout(m_VsyncPassed, m_VsyncMutex, 100) == SDL_MUTEX_TIMEDOUT) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"V-sync wait timed out after 100 ms");
|
||||||
|
}
|
||||||
|
SDL_UnlockMutex(m_VsyncMutex);
|
||||||
|
}
|
||||||
|
|
||||||
// Queue this sample for the next v-sync
|
// Queue this sample for the next v-sync
|
||||||
CMSampleTimingInfo timingInfo = {
|
CMSampleTimingInfo timingInfo = {
|
||||||
.duration = kCMTimeInvalid,
|
.duration = kCMTimeInvalid,
|
||||||
@ -319,16 +329,6 @@ public:
|
|||||||
[m_DisplayLayer enqueueSampleBuffer:sampleBuffer];
|
[m_DisplayLayer enqueueSampleBuffer:sampleBuffer];
|
||||||
|
|
||||||
CFRelease(sampleBuffer);
|
CFRelease(sampleBuffer);
|
||||||
|
|
||||||
if (m_DisplayLink != nullptr) {
|
|
||||||
// Vsync is enabled, so wait for a swap before returning
|
|
||||||
SDL_LockMutex(m_VsyncMutex);
|
|
||||||
if (SDL_CondWaitTimeout(m_VsyncPassed, m_VsyncMutex, 100) == SDL_MUTEX_TIMEDOUT) {
|
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
"V-sync wait timed out after 100 ms");
|
|
||||||
}
|
|
||||||
SDL_UnlockMutex(m_VsyncMutex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool initialize(PDECODER_PARAMETERS params) override
|
virtual bool initialize(PDECODER_PARAMETERS params) override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user