From f23ff0394d8ae58dc12f8d1076fe5cd9dfde383d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 26 Apr 2019 15:58:25 -0700 Subject: Specify the buffer size as itself instead of the period count Certain backends don't need a buffer size to be a strict multiple of the period count, which allows a little more flexibility. The period/update size simply acts as the minimum request, which helps control CPU load by determining how often parameter and other pre-mixing updates are processed. --- Alc/backends/base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Alc/backends/base.cpp') diff --git a/Alc/backends/base.cpp b/Alc/backends/base.cpp index ba5e5486..5239ae5b 100644 --- a/Alc/backends/base.cpp +++ b/Alc/backends/base.cpp @@ -51,7 +51,7 @@ ClockLatency BackendBase::getClockLatency() * any given time during playback. Without a more accurate measurement from * the output, this is an okay approximation. */ - ret.Latency = std::chrono::seconds{mDevice->UpdateSize*maxi(mDevice->NumUpdates-1, 0)}; + ret.Latency = std::chrono::seconds{maxi(mDevice->BufferSize-mDevice->UpdateSize, 0)}; ret.Latency /= mDevice->Frequency; return ret; -- cgit v1.2.3