summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-04-12 20:13:53 +0200
committerwm4 <wm4@nowhere>2014-04-12 20:13:53 +0200
commit19abeaf62d408f2ef2436f67ef12a3ac2120638a (patch)
treee6546dff9cffc8da5b5f55fd9ddf335da2d2204b
parent4e5cea86c29508c24bf6f5539eeddd388abfde0a (diff)
downloadmpv-19abeaf62d408f2ef2436f67ef12a3ac2120638a.tar.bz2
mpv-19abeaf62d408f2ef2436f67ef12a3ac2120638a.tar.xz
lua: wrap mpv_get_wakeup_pipe()
Pretty much experimental for issue #661.
-rw-r--r--DOCS/man/en/lua.rst4
-rw-r--r--player/lua.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/DOCS/man/en/lua.rst b/DOCS/man/en/lua.rst
index 45d8bb983b..3a4e0d0a92 100644
--- a/DOCS/man/en/lua.rst
+++ b/DOCS/man/en/lua.rst
@@ -334,6 +334,10 @@ The ``mp`` module is preloaded, although it can be loaded manually with
long time, but doesn't really need access to the player (like a network
operation). Note that you still can access the player at any time.
+``mp.get_wakeup_pipe()``
+ Calls ``mpv_get_wakeup_pipe()`` and returns the read end of the wakeup
+ pipe. (See ``client.h`` for details.)
+
``mp.enable_messages(level)``
Set the minimum log level of which mpv message output to receive. These
messages are normally printed to the terminal. By calling this function,
diff --git a/player/lua.c b/player/lua.c
index e9065d488b..36cbadcd3b 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -1047,6 +1047,13 @@ static int script_format_time(lua_State *L)
return 1;
}
+static int script_get_wakeup_pipe(lua_State *L)
+{
+ struct script_ctx *ctx = get_ctx(L);
+ lua_pushinteger(L, mpv_get_wakeup_pipe(ctx->client));
+ return 1;
+}
+
struct fn_entry {
const char *name;
int (*fn)(lua_State *L);
@@ -1085,6 +1092,7 @@ static struct fn_entry fn_list[] = {
FN_ENTRY(input_set_section_mouse_area),
FN_ENTRY(format_time),
FN_ENTRY(enable_messages),
+ FN_ENTRY(get_wakeup_pipe),
};
// On stack: mp table