SDL audio: don't close audio device if not open

issue #2068
This commit is contained in:
tildearrow 2024-08-22 22:20:25 -05:00
parent a08380182d
commit 231bece848
2 changed files with 4 additions and 1 deletions

View file

@ -46,7 +46,9 @@ void* TAAudioSDL::getContext() {
bool TAAudioSDL::quit() {
if (!initialized) return false;
if (ai!=0) {
SDL_CloseAudioDevice(ai);
}
if (running) {
running=false;

View file

@ -34,5 +34,6 @@ class TAAudioSDL: public TAAudio {
std::vector<String> listAudioDevices();
bool init(TAAudioDesc& request, TAAudioDesc& response);
TAAudioSDL():
ai(0),
audioSysStarted(false) {}
};