In the file soloud_audiosource.cpp we find the function:
result AudioSourceInstance::seek(double aSeconds, float *mScratch, unsigned int mScratchSize)
{
...
while (samples_to_discard)
{
int samples = mScratchSize / mChannels;
if (samples > samples_to_discard)
samples = samples_to_discard;
getAudio(mScratch, samples, samples);
samples_to_discard -= samples;
}
mStreamPosition = aSeconds;
return SO_NO_ERROR;
}
I ran into an issue were this loop never terminates. Upon investigation I found, that mScratchSize was zero. This is some internal parameter, for which I do not understand how and when it is computed, but clearly it should never be 0 when this function is called.
For now I implemented a small fix, where the function simply returns if scratch size is zero, however I think the real error lies somewhere else. The code clearly relies on the assumption, that this situation can never occur, so either it should be fixed somewhere else, or, if an invalid state is reached caused by the user making invalid calls to the API, the error should be caught in this function.
In the file
soloud_audiosource.cppwe find the function:I ran into an issue were this loop never terminates. Upon investigation I found, that
mScratchSizewas zero. This is some internal parameter, for which I do not understand how and when it is computed, but clearly it should never be 0 when this function is called.For now I implemented a small fix, where the function simply returns if scratch size is zero, however I think the real error lies somewhere else. The code clearly relies on the assumption, that this situation can never occur, so either it should be fixed somewhere else, or, if an invalid state is reached caused by the user making invalid calls to the API, the error should be caught in this function.