summaryrefslogtreecommitdiffstats
path: root/player/lua.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-24 22:49:07 +0100
committerwm4 <wm4@nowhere>2014-02-24 22:50:25 +0100
commit0adb8a9aaf1e1c76300d717a0a3dd04849e70d1d (patch)
tree3dd2387c4eacd986a25a6025fac2e99aad621396 /player/lua.c
parent5d7007c6448660b2bdbc7758db7f486157ff1fa2 (diff)
downloadmpv-0adb8a9aaf1e1c76300d717a0a3dd04849e70d1d.tar.bz2
mpv-0adb8a9aaf1e1c76300d717a0a3dd04849e70d1d.tar.xz
client API: report pause/unpause reason
Not sure about this... might redo. At least this provides a case of a broadcasted event, which requires per-event data allocation. See github issue #576.
Diffstat (limited to 'player/lua.c')
-rw-r--r--player/lua.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/player/lua.c b/player/lua.c
index edd01c0c73..826de209ed 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -442,6 +442,22 @@ static int script_wait_event(lua_State *L)
lua_setfield(L, -2, "args"); // event
break;
}
+ case MPV_EVENT_PAUSE:
+ case MPV_EVENT_UNPAUSE:
+ {
+ mpv_event_pause_reason *msg = event->data;
+ lua_pushboolean(L, msg->real_paused);
+ lua_setfield(L, -2, "real_paused");
+ lua_pushboolean(L, msg->user_paused);
+ lua_setfield(L, -2, "user_paused");
+ lua_pushboolean(L, msg->by_command);
+ lua_setfield(L, -2, "by_command");
+ lua_pushboolean(L, msg->by_cache);
+ lua_setfield(L, -2, "by_cache");
+ lua_pushboolean(L, msg->by_keep_open);
+ lua_setfield(L, -2, "by_keep_open");
+ break;
+ }
default: ;
}