Fix regression that was causing video stuttering (#2503)

This commit is contained in:
flashback-fx 2022-06-05 11:14:26 +02:00 committed by GitHub
parent 6fccfc57a4
commit cda89ebb58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4834,6 +4834,7 @@ void WaitTime(float ms)
while ((currentTime - previousTime) < ms/1000.0f) currentTime = GetTime(); while ((currentTime - previousTime) < ms/1000.0f) currentTime = GetTime();
#else #else
#if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP)
double destTime = GetTime() + ms/1000.0f;
double busyWait = ms*0.05; // NOTE: We are using a busy wait of 5% of the time double busyWait = ms*0.05; // NOTE: We are using a busy wait of 5% of the time
ms -= (float)busyWait; ms -= (float)busyWait;
#endif #endif
@ -4857,11 +4858,7 @@ void WaitTime(float ms)
#endif #endif
#if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) #if defined(SUPPORT_PARTIALBUSY_WAIT_LOOP)
double previousTime = GetTime(); while (GetTime() < destTime) { }
double currentTime = 0.0;
// Partial busy wait loop (only a fraction of the total wait time)
while ((currentTime - previousTime) < (busyWait/1000.0f)) currentTime = GetTime();
#endif #endif
#endif #endif
} }