Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(audio): close the audio device after playing a sound
Browse files Browse the repository at this point in the history
This bug was uncovered by 65896e4
because this sound now happens after the call is closed, but doesn't
close the audio device.
  • Loading branch information
sudden6 committed May 15, 2018
1 parent e55f86c commit a337017
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/audio/backend/openal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a337017

Please sign in to comment.