aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/backends/base.cpp')
-rw-r--r--alc/backends/base.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/alc/backends/base.cpp b/alc/backends/base.cpp
index ab3ad028..b287b6d9 100644
--- a/alc/backends/base.cpp
+++ b/alc/backends/base.cpp
@@ -45,21 +45,20 @@ uint BackendBase::availableSamples()
ClockLatency BackendBase::getClockLatency()
{
- ClockLatency ret;
+ ClockLatency ret{};
uint refcount;
do {
refcount = mDevice->waitForMix();
- ret.ClockTime = GetDeviceClockTime(mDevice);
+ ret.ClockTime = mDevice->getClockTime();
std::atomic_thread_fence(std::memory_order_acquire);
- } while(refcount != ReadRef(mDevice->MixCount));
+ } while(refcount != mDevice->mMixCount.load(std::memory_order_relaxed));
/* NOTE: The device will generally have about all but one periods filled at
* any given time during playback. Without a more accurate measurement from
* the output, this is an okay approximation.
*/
- ret.Latency = std::max(std::chrono::seconds{mDevice->BufferSize-mDevice->UpdateSize},
- std::chrono::seconds::zero());
+ ret.Latency = std::chrono::seconds{mDevice->BufferSize - mDevice->UpdateSize};
ret.Latency /= mDevice->Frequency;
return ret;