1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(audio): Clear audio buffer when ending audio loop

This commit is contained in:
Alice Weigt 2016-10-26 02:20:50 -07:00
parent ce9406c959
commit 244d1dc386

View File

@ -721,4 +721,13 @@ void Audio::stopLoop()
QMutexLocker locker(&audioLock);
alSourcei(alMainSource, AL_LOOPING, AL_FALSE);
alSourceStop(alMainSource);
ALint state;
alGetSourcei(alMainSource, AL_SOURCE_STATE, &state);
if (state == AL_STOPPED)
{
alSourcei(alMainSource, AL_BUFFER, AL_NONE);
alDeleteBuffers(1, &alMainBuffer);
alMainBuffer = 0;
}
}