mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-03-05 07:07:18 +00:00
Fixed not working frame pacing on macOS
This commit is contained in:
parent
bb235ab1ae
commit
1046d264d8
1 changed files with 10 additions and 10 deletions
|
@ -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…
Add table
Reference in a new issue