Skip to content

Commit

Permalink
Do not duplicate AudioManager::init/deinit
Browse files Browse the repository at this point in the history
  • Loading branch information
o-p-a committed Aug 28, 2024
1 parent 2acbcc2 commit 8619c2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions es-core/src/AudioManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ std::shared_ptr<AudioManager> & AudioManager::getInstance()

void AudioManager::init()
{
if(sInstance)
return;

if (SDL_InitSubSystem(SDL_INIT_AUDIO) != 0)
{
LOG(LogError) << "Error initializing SDL audio!\n" << SDL_GetError();
Expand Down Expand Up @@ -103,6 +106,9 @@ void AudioManager::init()

void AudioManager::deinit()
{
if(!sInstance)
return;

//stop all playback
stop();
//completely tear down SDL audio. else SDL hogs audio resources and emulators might fail to start...
Expand Down

0 comments on commit 8619c2d

Please sign in to comment.