From f60826c3a14ba3b49077f17e5364b7347f9b468a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Mar 2018 16:24:49 +0100 Subject: client API: add a first class hook API, and deprecate old API As it turns out, there are multiple libmpv users who saw a need to use the hook API. The API is kind of shitty and was never meant to be actually public (it was mostly a hack for the ytdl script). Introduce a proper API and deprecate the old one. The old one will probably continue to work for a few releases, but will be removed eventually. There are some slight changes to the old API, but if a user followed the manual properly, it won't break. Mostly untested. Appears to work with ytdl_hook. --- player/scripting.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player/scripting.c') diff --git a/player/scripting.c b/player/scripting.c index 9d2cd97de5..b98588d948 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -207,7 +207,8 @@ static void load_builtin_script(struct MPContext *mpctx, bool enable, // terminated, or re-enabling the script could be racy (because it'd // recognize a still-terminating script as "loaded"). while (mp_client_exists(mpctx, name)) { - if (mp_client_send_event(mpctx, name, MPV_EVENT_SHUTDOWN, NULL) < 0) + if (mp_client_send_event(mpctx, name, 0, MPV_EVENT_SHUTDOWN, + NULL) < 0) break; mp_idle(mpctx); } -- cgit v1.2.3