Browse Source

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.
reviewable/pr5122/r1
sudden6 7 years ago
parent
commit
a3370173df
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 4
      src/audio/backend/openal.cpp

4
src/audio/backend/openal.cpp

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

Loading…
Cancel
Save