From b9e4fb952dbfc3b0b021fb3a838c4ab0328808cf Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 24 Mar 2017 15:31:01 +0100 Subject: command: add a property to signal whether networking is used Requested. The property semantics are a bit muddy due to lack of effort. Anticipated use is different display of cache status, so it should not matter anyway. --- player/command.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'player') diff --git a/player/command.c b/player/command.c index ae01796f31..c490f9db61 100644 --- a/player/command.c +++ b/player/command.c @@ -1742,6 +1742,17 @@ static int mp_property_cache_buffering(void *ctx, struct m_property *prop, return m_property_int_ro(action, arg, state); } +static int mp_property_demuxer_is_network(void *ctx, struct m_property *prop, + int action, void *arg) +{ + MPContext *mpctx = ctx; + if (!mpctx->demuxer) + return M_PROPERTY_UNAVAILABLE; + + return m_property_flag_ro(action, arg, mpctx->demuxer->is_network); +} + + static int mp_property_clock(void *ctx, struct m_property *prop, int action, void *arg) { @@ -3906,6 +3917,7 @@ static const struct m_property mp_properties_base[] = { {"demuxer-cache-idle", mp_property_demuxer_cache_idle}, {"cache-buffering-state", mp_property_cache_buffering}, {"paused-for-cache", mp_property_paused_for_cache}, + {"demuxer-via-network", mp_property_demuxer_is_network}, {"clock", mp_property_clock}, {"seekable", mp_property_seekable}, {"partially-seekable", mp_property_partially_seekable}, -- cgit v1.2.3