From 5d7007c6448660b2bdbc7758db7f486157ff1fa2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 24 Feb 2014 21:59:20 +0100 Subject: 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. --- libmpv/client.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libmpv') diff --git a/libmpv/client.h b/libmpv/client.h index 462ff3a9bd..a37afdbcb5 100644 --- a/libmpv/client.h +++ b/libmpv/client.h @@ -350,6 +350,18 @@ void mpv_suspend(mpv_handle *ctx); */ void mpv_resume(mpv_handle *ctx); +/** + * Return the internal time in microseconds. This has an arbitrary start offset, + * but will never wrap or go backwards (note: the latter is probably a lie in + * the current implementation, it can go backwards on system clock changes). + * + * Note that this is always the real time, and doesn't necessarily have to do + * with playback time. For example, playback could go faster or slower due to + * playback speed, or due to playback being paused. Use the "time-pos" property + * instead to get the playback status. + */ +int64_t mpv_get_time_us(mpv_handle *ctx); + /** * Data format for options and properties. The API functions to get/set * properties and options support multiple formats, and this enum describes -- cgit v1.2.3