diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index 892c701a3..f77756cd8 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -199,7 +199,6 @@ void FileData::launchGame(Window* window) window->init(); VolumeControl::getInstance()->init(); - AudioManager::getInstance()->init(); window->normalizeNextUpdate(); //update number of times the game has been launched @@ -274,4 +273,4 @@ FileData::SortType getSortTypeFromString(std::string desc) { } // if not found default to name, ascending return FileSorts::SortTypes.at(0); -} \ No newline at end of file +} diff --git a/es-core/src/AudioManager.cpp b/es-core/src/AudioManager.cpp index cbc0821ed..e4e3dce12 100644 --- a/es-core/src/AudioManager.cpp +++ b/es-core/src/AudioManager.cpp @@ -106,6 +106,7 @@ void AudioManager::deinit() //completely tear down SDL audio. else SDL hogs audio resources and emulators might fail to start... SDL_CloseAudio(); SDL_QuitSubSystem(SDL_INIT_AUDIO); + sInstance = NULL; } void AudioManager::registerSound(std::shared_ptr & sound) diff --git a/es-core/src/Sound.cpp b/es-core/src/Sound.cpp index c915ea544..22d17b959 100644 --- a/es-core/src/Sound.cpp +++ b/es-core/src/Sound.cpp @@ -114,6 +114,8 @@ void Sound::play() if(!Settings::getInstance()->getBool("EnableSounds")) return; + AudioManager::getInstance(); + SDL_LockAudio(); if (playing) { diff --git a/es-core/src/components/VideoPlayerComponent.cpp b/es-core/src/components/VideoPlayerComponent.cpp index abeae844c..b1aa98617 100644 --- a/es-core/src/components/VideoPlayerComponent.cpp +++ b/es-core/src/components/VideoPlayerComponent.cpp @@ -191,11 +191,6 @@ void VideoPlayerComponent::stopVideo() int status; kill(mPlayerPid, SIGKILL); waitpid(mPlayerPid, &status, WNOHANG); - // Restart AudioManager - if (boost::starts_with(Settings::getInstance()->getString("OMXAudioDev").c_str(), "alsa")) - { - AudioManager::getInstance()->init(); - } mPlayerPid = -1; } }