SDL: Use DirectSound audio driver by default on Windows

This commit is contained in:
Vicki Pfau 2020-02-11 02:14:39 +00:00
parent afbf3f8e34
commit 00b46d7041
2 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,7 @@ Misc:
- FFmpeg: Add looping option for GIF/APNG - FFmpeg: Add looping option for GIF/APNG
- Qt: Renderer can be changed while a game is running - Qt: Renderer can be changed while a game is running
- Qt: Fix non-SDL build (fixes mgba.io/i/1656) - Qt: Fix non-SDL build (fixes mgba.io/i/1656)
- SDL: Use DirectSound audio driver by default on Windows
- Switch: Make OpenGL scale adjustable while running - Switch: Make OpenGL scale adjustable while running
0.8.0: (2020-01-21) 0.8.0: (2020-01-21)

View File

@ -19,6 +19,11 @@ mLOG_DEFINE_CATEGORY(SDL_AUDIO, "SDL Audio", "platform.sdl.audio");
static void _mSDLAudioCallback(void* context, Uint8* data, int len); static void _mSDLAudioCallback(void* context, Uint8* data, int len);
bool mSDLInitAudio(struct mSDLAudio* context, struct mCoreThread* threadContext) { bool mSDLInitAudio(struct mSDLAudio* context, struct mCoreThread* threadContext) {
#if defined(_WIN32) && SDL_VERSION_ATLEAST(2, 0, 8)
if (!getenv("SDL_AUDIODRIVER")) {
_putenv_s("SDL_AUDIODRIVER", "directsound");
}
#endif
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
mLOG(SDL_AUDIO, ERROR, "Could not initialize SDL sound system: %s", SDL_GetError()); mLOG(SDL_AUDIO, ERROR, "Could not initialize SDL sound system: %s", SDL_GetError());
return false; return false;