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/sdl2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Alc/backends/sdl2.cpp') diff --git a/Alc/backends/sdl2.cpp b/Alc/backends/sdl2.cpp index a1011735..51c927cc 100644 --- a/Alc/backends/sdl2.cpp +++ b/Alc/backends/sdl2.cpp @@ -146,7 +146,7 @@ ALCenum Sdl2Backend::open(const ALCchar *name) return ALC_INVALID_VALUE; } mDevice->UpdateSize = have.samples; - mDevice->NumUpdates = 2; /* SDL always (tries to) use two periods. */ + mDevice->BufferSize = have.samples * 2; /* SDL always (tries to) use two periods. */ mFrameSize = mDevice->frameSizeFromFmt(); mFrequency = mDevice->Frequency; @@ -164,7 +164,7 @@ ALCboolean Sdl2Backend::reset() mDevice->FmtChans = mFmtChans; mDevice->FmtType = mFmtType; mDevice->UpdateSize = mUpdateSize; - mDevice->NumUpdates = 2; + mDevice->BufferSize = mUpdateSize * 2; SetDefaultWFXChannelOrder(mDevice); return ALC_TRUE; } -- cgit v1.2.3