mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-14 01:19:59 +00:00
Better handle bad OpenAL source counts
This commit is contained in:
parent
089c340935
commit
c072babd17
@ -415,12 +415,12 @@ void OpenAL_Output::init(const std::string &devname)
|
||||
alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
|
||||
throwALerror();
|
||||
|
||||
ALCint maxmono, maxstereo;
|
||||
ALCint maxmono=0, maxstereo=0;
|
||||
alcGetIntegerv(mDevice, ALC_MONO_SOURCES, 1, &maxmono);
|
||||
alcGetIntegerv(mDevice, ALC_STEREO_SOURCES, 1, &maxstereo);
|
||||
throwALCerror(mDevice);
|
||||
|
||||
mFreeSources.resize(std::min(maxmono+maxstereo, 256));
|
||||
mFreeSources.resize(std::min<ALCuint>(maxmono+maxstereo, 256));
|
||||
for(size_t i = 0;i < mFreeSources.size();i++)
|
||||
{
|
||||
ALuint src;
|
||||
|
Loading…
x
Reference in New Issue
Block a user