summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Hunstock <atze@fem.tu-ilmenau.de>2017-03-10 01:44:55 +0100
committerwm4 <wm4@nowhere>2017-03-25 14:44:11 +0100
commit3e93c09cffeb2395d12d9c7c61f2c7b836f77789 (patch)
tree46ad88b97ab76eb54369cd9e8d8e451df684c491
parentdbec486add260ba174ee448d58f3746971643e98 (diff)
downloadmpv-3e93c09cffeb2395d12d9c7c61f2c7b836f77789.tar.bz2
mpv-3e93c09cffeb2395d12d9c7c61f2c7b836f77789.tar.xz
command: add demux-start-time property
Add a demux_start_time property, update docs.
-rw-r--r--DOCS/man/input.rst3
-rw-r--r--player/command.c11
2 files changed, 14 insertions, 0 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index e14a69c770..9e578867cf 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -1232,6 +1232,9 @@ Property list
separate audio files or streams) do not influence the value of this
property (currently).
+``demuxer-start-time`` (R)
+ Returns the start time reported by the demuxer in fractional seconds.
+
``paused-for-cache``
Returns ``yes`` when playback is paused because of waiting for the cache.
diff --git a/player/command.c b/player/command.c
index c490f9db61..9050812fb3 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1723,6 +1723,16 @@ static int mp_property_demuxer_cache_idle(void *ctx, struct m_property *prop,
return m_property_flag_ro(action, arg, s.idle);
}
+static int mp_property_demuxer_start_time(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ if (!mpctx->demuxer)
+ return M_PROPERTY_UNAVAILABLE;
+
+ return m_property_double_ro(action, arg, mpctx->demuxer->start_time);
+}
+
static int mp_property_paused_for_cache(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3915,6 +3925,7 @@ static const struct m_property mp_properties_base[] = {
{"demuxer-cache-duration", mp_property_demuxer_cache_duration},
{"demuxer-cache-time", mp_property_demuxer_cache_time},
{"demuxer-cache-idle", mp_property_demuxer_cache_idle},
+ {"demuxer-start-time", mp_property_demuxer_start_time},
{"cache-buffering-state", mp_property_cache_buffering},
{"paused-for-cache", mp_property_paused_for_cache},
{"demuxer-via-network", mp_property_demuxer_is_network},