Skip to content

Commit

Permalink
sound: allow sfxInit to continue if audio lib is init
Browse files Browse the repository at this point in the history
This is how we are freeing SPU buffers to reload SFX for custom themes
  • Loading branch information
KrahJohlito committed Jul 5, 2020
1 parent ab33508 commit 8b252bf
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,16 @@ int sfxInit(int bootSnd)
int thmSfxEnabled = 0;
int i = 1;

if (sfx_initialized)
if (!sfx_initialized)
{
LOG("SFX: %s: ERROR: already initialized!\n", __FUNCTION__);
return -1;
}

if (audsrv_init() != 0) {
LOG("SFX: Failed to initialize audsrv\n");
LOG("SFX: Audsrv returned error string: %s\n", audsrv_get_error_string());
return -2;
if (audsrv_init() != 0) {
LOG("SFX: Failed to initialize audsrv\n");
LOG("SFX: Audsrv returned error string: %s\n", audsrv_get_error_string());
return -1;
}
sfx_initialized = 1;
}

sfx_initialized = 1;

audsrv_adpcm_init();

sfxInitDefaults();
Expand Down

0 comments on commit 8b252bf

Please sign in to comment.