From b9c42755a75d74f5cd48737e714d31589fcac6a0 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 25 Oct 2023 18:17:25 -0500 Subject: javascript: use --js-memory-report option instead of MPV_LEAK_REPORT The MPV_LEAK_REPORT environment variable was previously read in order to determine whether or not to enable memory reporting for javascript scripts. This is kind of weird and deviates from the norm of exposing an option to the user. So let's just add --js-memory-report and disable it by default instead. --- options/options.c | 3 +++ options/options.h | 1 + 2 files changed, 4 insertions(+) (limited to 'options') diff --git a/options/options.c b/options/options.c index 2bad7abb45..d842db2acb 100644 --- a/options/options.c +++ b/options/options.c @@ -490,6 +490,9 @@ static const m_option_t mp_opts[] = { {"script-opts", OPT_KEYVALUELIST(script_opts)}, {"load-scripts", OPT_BOOL(auto_load_scripts)}, #endif +#if HAVE_JAVASCRIPT + {"js-memory-report", OPT_BOOL(js_memory_report)}, +#endif #if HAVE_LUA {"osc", OPT_BOOL(lua_load_osc), .flags = UPDATE_BUILTIN_SCRIPTS}, {"ytdl", OPT_BOOL(lua_load_ytdl), .flags = UPDATE_BUILTIN_SCRIPTS}, diff --git a/options/options.h b/options/options.h index 6adae372cf..3c730cebf5 100644 --- a/options/options.h +++ b/options/options.h @@ -157,6 +157,7 @@ typedef struct MPOpts { char **reset_options; char **script_files; char **script_opts; + bool js_memory_report; bool lua_load_osc; bool lua_load_ytdl; char *lua_ytdl_format; -- cgit v1.2.3