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

fix(audio): close the audio device after playing a sound

This bug was uncovered by 65896e4501
because this sound now happens after the call is closed, but doesn't
close the audio device.
This commit is contained in:
sudden6 2018-05-05 14:24:52 +02:00
parent e55f86c6a5
commit a3370173df
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -521,6 +521,10 @@ void OpenAL::playMono16SoundCleanup()
alSourcei(alMainSource, AL_BUFFER, AL_NONE); alSourcei(alMainSource, AL_BUFFER, AL_NONE);
alDeleteBuffers(1, &alMainBuffer); alDeleteBuffers(1, &alMainBuffer);
alMainBuffer = 0; alMainBuffer = 0;
// close the audio device if no other sources active
if (peerSources.isEmpty()) {
cleanupOutput();
}
} else { } else {
// the audio didn't finish, try again later // the audio didn't finish, try again later
playMono16Timer.start(10); playMono16Timer.start(10);