diff --git a/player/main.c b/player/main.c index bc08310e9c..be14dfe03b 100644 --- a/player/main.c +++ b/player/main.c @@ -454,6 +454,10 @@ int mp_initialize(struct MPContext *mpctx, char **options) mp_get_resume_defaults(mpctx); + // Lua user scripts (etc.) can call arbitrary functions. Load them at a point + // where this is safe. + mp_load_scripts(mpctx); + if (opts->consolecontrols && cas_terminal_owner(mpctx, mpctx)) terminal_setup_getch(mpctx->input); @@ -478,10 +482,6 @@ int mp_initialize(struct MPContext *mpctx, char **options) mpctx->mouse_cursor_visible = true; } - // Lua user scripts (etc.) can call arbitrary functions. Load them at a point - // where this is safe. - mp_load_scripts(mpctx); - #if !defined(__MINGW32__) mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global); #endif