diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2024-04-19 00:49:28 -0400 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2024-04-19 21:04:02 +0200 |
commit | 5109c599dba576d1fabd6ac11dfae43ec260034e (patch) | |
tree | 4daffa5338796e235331e7643e198dad41215b07 /input | |
parent | 1a495451ab13ada7d4134258accaa6927262d554 (diff) | |
download | mpv-5109c599dba576d1fabd6ac11dfae43ec260034e.tar.bz2 mpv-5109c599dba576d1fabd6ac11dfae43ec260034e.tar.xz |
input: fix deadlock in adding gamepad input src
mp_input_sdl_gamepad_add() calls mp_input_add_thread_src() which
already locks, so it cannot be called inside a lock.
Missed in e8b9476bf706401fa0e57fb117012124264483d2 refactoring.
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/input/input.c b/input/input.c index d4cea80853..b24e82fe50 100644 --- a/input/input.c +++ b/input/input.c @@ -1414,13 +1414,15 @@ void mp_input_load_config(struct input_ctx *ictx) talloc_free(tmp); } + bool use_gamepad = ictx->opts->use_gamepad; + input_unlock(ictx); + #if HAVE_SDL2_GAMEPAD - if (ictx->opts->use_gamepad) { + if (use_gamepad) mp_input_sdl_gamepad_add(ictx); - } +#else + (void)use_gamepad; #endif - - input_unlock(ictx); } bool mp_input_load_config_file(struct input_ctx *ictx, char *file) |