Merge remote branch 'corristo/openal'

actorid
Marc Zinnschlag 13 years ago
commit cc9a874f2b

@ -441,6 +441,27 @@ void OpenAL_Output::init(const std::string &devname)
try
{
ALCuint maxtotal = std::min<ALCuint>(maxmono+maxstereo, 256);
if (maxtotal == 0) // workaround for broken implementations
{
maxtotal = 256;
bool stop = false;
for(size_t i = 0;i < maxtotal && !stop;i++) // generate source until error returned
{
ALuint src = 0;
alGenSources(1, &src);
ALenum err = alGetError();
if(err != AL_NO_ERROR)
{
stop = true;
}
else
{
mFreeSources.push_back(src);
}
}
}
else // normal case
{
for(size_t i = 0;i < maxtotal;i++)
{
ALuint src = 0;
@ -449,6 +470,7 @@ void OpenAL_Output::init(const std::string &devname)
mFreeSources.push_back(src);
}
}
}
catch(std::exception &e)
{
std::cout <<"Error: "<<e.what()<<", trying to continue"<< std::endl;

Loading…
Cancel
Save