From 3e93c09cffeb2395d12d9c7c61f2c7b836f77789 Mon Sep 17 00:00:00 2001 From: Matthias Hunstock Date: Fri, 10 Mar 2017 01:44:55 +0100 Subject: [PATCH] command: add demux-start-time property Add a demux_start_time property, update docs. --- DOCS/man/input.rst | 3 +++ player/command.c | 11 +++++++++++ 2 files changed, 14 insertions(+) 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},