summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-03-26 23:58:09 +0100
committerwm4 <wm4@nowhere>2020-03-26 23:59:44 +0100
commit1a720377203f7cee2ab949c5aa2bc9e0a2a7e0f2 (patch)
treebc2028b3823c06d59091797536c32623ebc555a8 /player/core.h
parent9bda301eb4d8aa75d435f24146c3a66ab74cafea (diff)
downloadmpv-1a720377203f7cee2ab949c5aa2bc9e0a2a7e0f2.tar.bz2
mpv-1a720377203f7cee2ab949c5aa2bc9e0a2a7e0f2.tar.xz
scripting: remove race condition when toggling internal scripts
Scripts such as the OSC can be loaded and unloaded at runtime by toggling the option that enables them. (It even works, although normally it's only used to control initial loading.) Unloading was racy because it used the client name; fix this. The load-script change is an accidental feature. And probably useless.
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/player/core.h b/player/core.h
index 5161b07799..9472dfefd3 100644
--- a/player/core.h
+++ b/player/core.h
@@ -444,6 +444,8 @@ typedef struct MPContext {
struct mp_ipc_ctx *ipc_ctx;
+ int64_t builtin_script_ids[4];
+
pthread_mutex_t abort_lock;
// --- The following fields are protected by abort_lock
@@ -632,7 +634,7 @@ struct mp_scripting {
};
bool mp_load_scripts(struct MPContext *mpctx);
void mp_load_builtin_scripts(struct MPContext *mpctx);
-int mp_load_user_script(struct MPContext *mpctx, const char *fname);
+int64_t mp_load_user_script(struct MPContext *mpctx, const char *fname);
// sub.c
void reset_subtitle_state(struct MPContext *mpctx);