Fixed an issue where the audio device was accessed after it had been closed.

This commit is contained in:
Leon Styhre 2022-01-05 00:08:50 +01:00
parent f8e201d347
commit c62a069448
3 changed files with 4 additions and 3 deletions

View file

@ -529,10 +529,8 @@ int main(int argc, char* argv[])
}
Window* window = Window::getInstance();
ViewController::getInstance();
CollectionSystemsManager::getInstance();
SystemScreensaver screensaver;
MediaViewer mediaViewer;
GuiLaunchScreen guiLaunchScreen;

View file

@ -119,6 +119,8 @@ void AudioManager::deinit()
SDL_CloseAudio();
SDL_QuitSubSystem(SDL_INIT_AUDIO);
sAudioDevice = 0;
}
void AudioManager::mixAudio(void* /*unused*/, Uint8* stream, int len)

View file

@ -1412,6 +1412,7 @@ void VideoFFmpegComponent::stopVideo()
std::queue<AudioFrame>().swap(mAudioFrameQueue);
// Clear the audio buffer.
if (AudioManager::sAudioDevice != 0)
AudioManager::getInstance().clearStream();
if (mFormatContext) {