aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/sdl2.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-04-26 15:58:25 -0700
committerChris Robinson <[email protected]>2019-04-26 15:58:25 -0700
commitf23ff0394d8ae58dc12f8d1076fe5cd9dfde383d (patch)
tree6ab98ccc85c76eb77bf8c533cdaae179fb0b6bd4 /Alc/backends/sdl2.cpp
parent348e01dc4bc16ac4543d54b722fb46dbdebcb1e3 (diff)
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.
Diffstat (limited to 'Alc/backends/sdl2.cpp')
-rw-r--r--Alc/backends/sdl2.cpp4
1 files changed, 2 insertions, 2 deletions
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;
}