Closed sercero closed 3 years ago
@paroj your suggestions let me thinking about the original code and that there might be some merit in what they were doing.
What they were doing is calling alGenSources()
until MaxSources or until it failed.
My changes assumed that there is always enough memory to create MaxSources, but I don't know how much memory does it take but probably is not much.
I have to think this change better.
Should I close the pull request?
there might be some merit in what they were doing.
yes, according to this, it is the only documented way to stay below the context limit: https://stackoverflow.com/questions/2871905/openal-determine-maximum-sources
however, given that OpenAL Soft is the go-to implementation nowadays, you could also just assume that the 100 sources we request by default just work.
@paroj I will open another pull request since I created a new branch with a slightly different approach
superceded by #24
In function
OgreOggSoundManager::_createSourcePool()
there were lots of calls toalGenSources()
, they were replaced with one call (same thing when releasing withalDeleteSources()
).Initially the objective was to try to understand why I'm getting this warning from OpenAL Soft: "[ALSOFT] (WW) 1 Source not deleted".
So, the problem was that
mSourcePool
was being used inOgreOggSoundManager::_releaseAll()
to query which sources to destroy.That is wrong because the pool gets depeleted each time that a sound source is requested by the Manager.
In sinthesis:
mSourcePool
should not be used to tell which sources to destroy at the end.