Skip to content

Commit

Permalink
OpenAL|Fixed: Fatal error during startup
Browse files Browse the repository at this point in the history
Attempting to use the OpenAL plugin for sound effect playback would
result in a fatal error during engine startup (tried to configure
a soundfont config without a music playback interface).
  • Loading branch information
danij-deng committed May 13, 2012
1 parent f855bdc commit 43ccd5e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions doomsday/engine/portable/src/s_mus.c
Expand Up @@ -121,6 +121,7 @@ boolean Mus_Init(void)

interfaces[0].ip = (audiointerface_music_generic_t*) AudioDriver_Music();
interfaces[1].ip = (audiointerface_music_generic_t*) AudioDriver_CD();
currentSong = -1;

for(i = 0; i < NUM_INTERFACES; ++i)
{
Expand All @@ -141,21 +142,25 @@ boolean Mus_Init(void)
{
if(!interfaces[i].ip)
strcpy(buf, "N/A");
else if( !interfaces[i].ip->Get(MUSIP_ID, buf))
else if(!interfaces[i].ip->Get(MUSIP_ID, buf))
strcpy(buf, "?");
Con_Message(" %-5s: %s\n", interfaces[i].name, buf);
}
}

if(AudioDriver_Interface(AudioDriver_Music())->Set)
if(!AudioDriver_Music() && !AudioDriver_CD())
{
// No interface for Music playback.
return false;
}

if(AudioDriver_Music() && AudioDriver_Interface(AudioDriver_Music())->Set)
{
// Tell the audio driver about our soundfont config.
AudioDriver_Interface(AudioDriver_Music())->Set(AUDIOP_SOUNDFONT_FILENAME, soundFontPath);
}

currentSong = -1;
musAvail = true;

return true;
}

Expand Down

0 comments on commit 43ccd5e

Please sign in to comment.