diff options
author | wm4 <wm4@nowhere> | 2014-02-11 00:23:10 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-11 00:23:10 +0100 |
commit | 33c6cbef3ab2be9ff8b818441b5cda101b913f15 (patch) | |
tree | ab643756437fcd2c464ee9e4e6be460263d17a3c /player/lua.c | |
parent | 444f79d86f5483a35f83d3a5efc9cea859f88bf8 (diff) | |
download | mpv-33c6cbef3ab2be9ff8b818441b5cda101b913f15.tar.bz2 mpv-33c6cbef3ab2be9ff8b818441b5cda101b913f15.tar.xz |
lua: add set_property function
Diffstat (limited to 'player/lua.c')
-rw-r--r-- | player/lua.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/player/lua.c b/player/lua.c index e7ff414298..922b49417a 100644 --- a/player/lua.c +++ b/player/lua.c @@ -468,6 +468,15 @@ static int script_commandv(lua_State *L) return check_error(L, mpv_command(ctx->client, args)); } +static int script_set_property(lua_State *L) +{ + struct script_ctx *ctx = get_ctx(L); + const char *p = luaL_checkstring(L, 1); + const char *v = luaL_checkstring(L, 2); + + return check_error(L, mpv_set_property_string(ctx->client, p, v)); +} + static int script_property_list(lua_State *L) { const struct m_option *props = mp_get_property_list(); @@ -734,6 +743,7 @@ static struct fn_entry fn_list[] = { FN_ENTRY(find_config_file), FN_ENTRY(command), FN_ENTRY(commandv), + FN_ENTRY(set_property), FN_ENTRY(property_list), FN_ENTRY(set_osd_ass), FN_ENTRY(get_osd_resolution), |