summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-03-21 22:17:05 +0100
committerwm4 <wm4@nowhere>2020-03-21 22:17:05 +0100
commit8a58a6993084aa9f3c8604d53dae40410136d414 (patch)
tree16ad2df3f42badd12af8d5a5cadf1bab87882be0 /player
parentd375cc304aec11f09ed685ffd2f2e7af0abf8910 (diff)
downloadmpv-8a58a6993084aa9f3c8604d53dae40410136d414.tar.bz2
mpv-8a58a6993084aa9f3c8604d53dae40410136d414.tar.xz
lua: simplify further
As suggested by avih. Obviously this was unnecessarily convoluted.
Diffstat (limited to 'player')
-rw-r--r--player/lua.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/player/lua.c b/player/lua.c
index 76a0d69e52..58f8396d17 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -504,17 +504,10 @@ static int script_wait_event(lua_State *L)
mpv_event *event = mpv_wait_event(ctx->client, luaL_optnumber(L, 1, 1e20));
- lua_newtable(L); // event
-
struct mpv_node rn;
mpv_event_to_node(&rn, event);
- assert(rn.format == MPV_FORMAT_NODE_MAP);
- mpv_node_list *list = rn.u.list;
- for (int n = 0; n < list->num; n++) {
- pushnode(L, &list->values[n]);
- lua_setfield(L, -2, list->keys[n]);
- }
+ pushnode(L, &rn); // event
mpv_free_node_contents(&rn);