// (c) 1995-2014 by Artsoft Entertainment
// Holger Schemel
// info@artsoft.org
-// http://www.artsoft.org/
+// https://www.artsoft.org/
// ----------------------------------------------------------------------------
// sound.c
// ============================================================================
{
if (!mixer[i].active)
{
- Error(ERR_INFO, "Mixer_InsertSound: Channel %d inactive", i);
- Error(ERR_INFO, "Mixer_InsertSound: This should never happen!");
+ Debug("audio", "Mixer_InsertSound: Channel %d inactive", i);
+ Debug("audio", "Mixer_InsertSound: This should never happen!");
mixer_active_channels--;
}
if ((snd_info->data_ptr = Mix_LoadWAV(filename)) == NULL)
{
- Error(ERR_WARN, "cannot read sound file '%s': %s", filename, Mix_GetError());
+ Warn("cannot read sound file '%s': %s", filename, Mix_GetError());
+
free(snd_info);
+
return NULL;
}
if ((mod_info->data_ptr = Mix_LoadMUS(filename)) == NULL)
{
- Error(ERR_WARN, "cannot read music file '%s': %s", filename, Mix_GetError());
+ Warn("cannot read music file '%s': %s", filename, Mix_GetError());
+
free(mod_info);
+
return NULL;
}
if ((dir = openDirectory(music_directory)) == NULL)
{
- Error(ERR_WARN, "cannot read music directory '%s'", music_directory);
+ Warn("cannot read music directory '%s'", music_directory);
audio.music_available = FALSE;