mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-18 11:55:38 +00:00
SDL: Fix compilation on older versions
This commit is contained in:
parent
bc9246b444
commit
b9bfe30b1e
|
@ -39,7 +39,14 @@ bool SDLAudioStream::OpenDevice()
|
||||||
spec.userdata = static_cast<void*>(this);
|
spec.userdata = static_cast<void*>(this);
|
||||||
|
|
||||||
SDL_AudioSpec obtained_spec = {};
|
SDL_AudioSpec obtained_spec = {};
|
||||||
m_device_id = SDL_OpenAudioDevice(nullptr, 0, &spec, &obtained_spec, SDL_AUDIO_ALLOW_SAMPLES_CHANGE);
|
|
||||||
|
#ifdef SDL_AUDIO_ALLOW_SAMPLES_CHANGE
|
||||||
|
const u32 allowed_change_flags = SDL_AUDIO_ALLOW_SAMPLES_CHANGE;
|
||||||
|
#else
|
||||||
|
const u32 allowed_change_flags = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_device_id = SDL_OpenAudioDevice(nullptr, 0, &spec, &obtained_spec, allowed_change_flags);
|
||||||
if (m_device_id == 0)
|
if (m_device_id == 0)
|
||||||
{
|
{
|
||||||
Log_ErrorPrintf("SDL_OpenAudioDevice() failed: %s", SDL_GetError());
|
Log_ErrorPrintf("SDL_OpenAudioDevice() failed: %s", SDL_GetError());
|
||||||
|
|
Loading…
Reference in a new issue