diff --git a/src/frontend-common/sdl_audio_stream.cpp b/src/frontend-common/sdl_audio_stream.cpp index 0bf4164f3..c88c7d7a0 100644 --- a/src/frontend-common/sdl_audio_stream.cpp +++ b/src/frontend-common/sdl_audio_stream.cpp @@ -39,7 +39,14 @@ bool SDLAudioStream::OpenDevice() spec.userdata = static_cast(this); 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) { Log_ErrorPrintf("SDL_OpenAudioDevice() failed: %s", SDL_GetError());