mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-11-30 09:44:55 +00:00
Fix V-Sync wait when frame period was less than 3 ms
This commit is contained in:
1 parent
f924722793
commit
ec59857a98
1 file changed
+4
-1
@@ -276,7 +276,10 @@ void Pacer::handleVsync(int timeUntilNextVsyncMillis)
|
||||
|
||||
if (m_PacingQueue.isEmpty()) {
|
||||
// Wait for a frame to arrive or our V-sync timeout to expire
|
||||
if (!m_PacingQueueNotEmpty.wait(&m_FrameQueueLock, SDL_max(timeUntilNextVsyncMillis, TIMER_SLACK_MS) - TIMER_SLACK_MS)) {
|
||||
unsigned long waitTimeMs = timeUntilNextVsyncMillis > 0
|
||||
? SDL_max(timeUntilNextVsyncMillis - TIMER_SLACK_MS, 1)
|
||||
: 0;
|
||||
if (!m_PacingQueueNotEmpty.wait(&m_FrameQueueLock, waitTimeMs)) {
|
||||
// Wait timed out - unlock and bail
|
||||
m_FrameQueueLock.unlock();
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user