Skip to content

Commit

Permalink
C4AudioSystemSdl: Log Mix_QuerySpec's return values to Clonk.log in o…
Browse files Browse the repository at this point in the history
…rder to better identify configuration issues
  • Loading branch information
Fulgen301 committed Oct 28, 2023
1 parent d34e93f commit 217523d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/C4AudioSystemSdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ C4AudioSystemSdl::C4AudioSystemSdl(const int maxChannels, const bool preferLinea
StdSdlSubSystem system{SDL_INIT_AUDIO};
ThrowIfFailed("Mix_OpenAudioDevice",
Mix_OpenAudioDevice(Frequency, Format, NumChannels, 1024, nullptr, SDL_AUDIO_ALLOW_ANY_CHANGE & ~SDL_AUDIO_ALLOW_CHANNELS_CHANGE) != 0);

int frequency;
Uint16 format;
int channels;
Mix_QuerySpec(&frequency, &format, &channels);

LogSilentF("SDL_mixer device spec: frequency = %d Hz, format = %hu, channels = %d", frequency, format, channels);

Mix_AllocateChannels(maxChannels);
Mix_ChannelFinished(ChannelFinished);
this->system.emplace(std::move(system));
Expand Down

0 comments on commit 217523d

Please sign in to comment.