diff options
author | Chris Robinson <[email protected]> | 2018-11-22 14:32:48 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-22 14:32:48 -0800 |
commit | d26b5d94677a7091d95972cbfd4337fb36a5e622 (patch) | |
tree | ea4a4a6133be65473914082ed314e4ea98dc20ef /Alc/backends/base.cpp | |
parent | 84f0f74d0794b38d1b1bb0021090d50f2648e0ce (diff) |
Use proper time types for the device clock time and latency
Diffstat (limited to 'Alc/backends/base.cpp')
-rw-r--r-- | Alc/backends/base.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/backends/base.cpp b/Alc/backends/base.cpp index 1839d353..e4c7588c 100644 --- a/Alc/backends/base.cpp +++ b/Alc/backends/base.cpp @@ -18,7 +18,7 @@ void ALCdevice_Unlock(ALCdevice *device) ClockLatency GetClockLatency(ALCdevice *device) { ClockLatency ret = V0(device->Backend,getClockLatency)(); - ret.Latency += device->FixedLatency.count(); + ret.Latency += device->FixedLatency; return ret; } @@ -65,8 +65,8 @@ ClockLatency ALCbackend_getClockLatency(ALCbackend *self) * any given time during playback. Without a more accurate measurement from * the output, this is an okay approximation. */ - ret.Latency = device->UpdateSize * DEVICE_CLOCK_RES / device->Frequency * - maxu(device->NumUpdates-1, 1); + ret.Latency = std::chrono::seconds{device->UpdateSize*maxi(device->NumUpdates-1, 0)}; + ret.Latency /= device->Frequency; return ret; } |