summaryrefslogtreecommitdiffstats
path: root/player/lua.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-24 21:59:20 +0100
committerwm4 <wm4@nowhere>2014-02-24 22:50:25 +0100
commit5d7007c6448660b2bdbc7758db7f486157ff1fa2 (patch)
treef1148f9ae9f528cf0dca93b25202866061e6f8f6 /player/lua.c
parent0797babbfa42ec29cf953070f520648e9d11d971 (diff)
downloadmpv-5d7007c6448660b2bdbc7758db7f486157ff1fa2.tar.bz2
mpv-5d7007c6448660b2bdbc7758db7f486157ff1fa2.tar.xz
client API: expose the internal clock
May or may not be useful in some ways. We require a context parameter for this just to be sure, even if the internal implementation currently doesn't. That's one less mpv internal function for the Lua wrapper.
Diffstat (limited to 'player/lua.c')
-rw-r--r--player/lua.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/lua.c b/player/lua.c
index dec5d22cab..edd01c0c73 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -722,7 +722,8 @@ static int script_get_mouse_pos(lua_State *L)
static int script_get_time(lua_State *L)
{
- lua_pushnumber(L, mp_time_sec());
+ struct script_ctx *ctx = get_ctx(L);
+ lua_pushnumber(L, mpv_get_time_us(ctx->client) / (double)(1000 * 1000));
return 1;
}