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:
parent
ce9406c959
commit
244d1dc386
|
@ -721,4 +721,13 @@ void Audio::stopLoop()
|
||||||
QMutexLocker locker(&audioLock);
|
QMutexLocker locker(&audioLock);
|
||||||
alSourcei(alMainSource, AL_LOOPING, AL_FALSE);
|
alSourcei(alMainSource, AL_LOOPING, AL_FALSE);
|
||||||
alSourceStop(alMainSource);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user