mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Merge pull request #9533 from zzmp/fix/sleep_until
Fix audio-mixer timing for WIN32
This commit is contained in:
commit
898c9b176d
1 changed files with 3 additions and 1 deletions
|
@ -468,7 +468,9 @@ std::chrono::microseconds AudioMixer::timeFrame(p_high_resolution_clock::time_po
|
|||
timestamp = std::max(now, nextTimestamp);
|
||||
|
||||
// sleep until the next frame should start
|
||||
std::this_thread::sleep_until(timestamp);
|
||||
// WIN32 sleep_until is broken until VS2015 Update 2
|
||||
// instead, std::max (above) guarantees that timestamp >= now, so we can sleep_for
|
||||
std::this_thread::sleep_for(timestamp - now);
|
||||
|
||||
return duration;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue