mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-18 22:12:18 +00:00
sdl2_driver: log errors from SDL_InitSubSystem and SDL_OpenAudioDevice (#425)
This commit is contained in:
parent
91f874cbad
commit
49cc504ced
1 changed files with 11 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include <apu/audio.h>
|
||||
#include <cpu/guest_thread.h>
|
||||
#include <kernel/heap.h>
|
||||
#include <os/logger.h>
|
||||
#include <user/config.h>
|
||||
|
||||
static PPCFunc* g_clientCallback{};
|
||||
|
|
@ -29,6 +30,9 @@ static void CreateAudioDevice()
|
|||
g_audioDevice = SDL_OpenAudioDevice(nullptr, 0, &desired, &obtained, 0);
|
||||
}
|
||||
|
||||
if (!g_audioDevice)
|
||||
LOGFN_ERROR("Failed to open audio device: {}", SDL_GetError());
|
||||
|
||||
g_downMixToStereo = (obtained.channels == 2);
|
||||
}
|
||||
|
||||
|
|
@ -36,7 +40,13 @@ void XAudioInitializeSystem()
|
|||
{
|
||||
SDL_SetHint(SDL_HINT_AUDIO_CATEGORY, "playback");
|
||||
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME, "Unleashed Recompiled");
|
||||
SDL_InitSubSystem(SDL_INIT_AUDIO);
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
|
||||
{
|
||||
LOGFN_ERROR("Failed to init audio subsystem: {}", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
CreateAudioDevice();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue