summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-03-24 15:31:01 +0100
committerwm4 <wm4@nowhere>2017-03-24 15:31:01 +0100
commitb9e4fb952dbfc3b0b021fb3a838c4ab0328808cf (patch)
tree3fc43d5f9c18319fdf9015ed1e3b204f39a7aadb /player
parent8de7ba6dfd87b1c62b0d057f1ed547360aff3eb1 (diff)
downloadmpv-b9e4fb952dbfc3b0b021fb3a838c4ab0328808cf.tar.bz2
mpv-b9e4fb952dbfc3b0b021fb3a838c4ab0328808cf.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/command.c12
1 files changed, 12 insertions, 0 deletions
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},