sdl_gamepad: add version check for SDL_HINT_JOYSTICK_THREAD

Requires SDL version 2.0.14.
This commit is contained in:
nanahi 2023-11-23 21:25:48 -05:00 committed by sfan5
parent 36a33b44b9
commit 19b27341a9
1 changed files with 2 additions and 0 deletions

View File

@ -200,7 +200,9 @@ static void remove_gamepad(struct mp_input_src *src, int id)
static void read_gamepad_thread(struct mp_input_src *src, void *param)
{
#if SDL_VERSION_ATLEAST(2, 0, 14)
SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1");
#endif
if (SDL_WasInit(SDL_INIT_EVENTS)) {
MP_ERR(src, "Another component is using SDL already.\n");