# Conflicts:
#	src/sound/oalsound.cpp
This commit is contained in:
Christoph Oelckers 2016-02-13 14:56:03 +01:00
commit e42dbb5087
2 changed files with 20 additions and 7 deletions

View file

@ -865,12 +865,6 @@ set( NOT_COMPILED_SOURCE_FILES
)
set( FASTMATH_SOURCES
nodebuild.cpp
nodebuild_classify_nosse2.cpp
nodebuild_events.cpp
nodebuild_extract.cpp
nodebuild_gl.cpp
nodebuild_utility.cpp
r_swrenderer.cpp
r_3dfloors.cpp
r_bsp.cpp
@ -1026,6 +1020,12 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
memarena.cpp
md5.cpp
name.cpp
nodebuild.cpp
nodebuild_classify_nosse2.cpp
nodebuild_events.cpp
nodebuild_extract.cpp
nodebuild_gl.cpp
nodebuild_utility.cpp
pathexpander.cpp
p_3dfloors.cpp
p_3dmidtex.cpp

View file

@ -781,7 +781,20 @@ OpenALSoundRenderer::OpenALSoundRenderer()
alcGetIntegerv(Device, ALC_MONO_SOURCES, 1, &numMono);
alcGetIntegerv(Device, ALC_STEREO_SOURCES, 1, &numStereo);
Sources.Resize(MIN<int>(MAX<int>(*snd_channels, 2), numMono+numStereo));
// OpenAL specification doesn't require alcGetIntegerv() to return
// meaningful values for ALC_MONO_SOURCES and ALC_MONO_SOURCES.
// At least Apple's OpenAL implementation returns zeroes,
// although it can generate reasonable number of sources.
const int numChannels = MAX<int>(*snd_channels, 2);
int numSources = numMono + numStereo;
if (0 == numSources)
{
numSources = numChannels;
}
Sources.Resize(MIN<int>(numChannels, numSources));
for(unsigned i = 0;i < Sources.Size();i++)
{
alGenSources(1, &Sources[i]);