1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

command: make input speed available as part of cache statge property

That's where it comes from after all. The other property does not have
much of a reason to exist anymore, but there's no real reason to remove
it either.
This commit is contained in:
wm4 2020-04-03 13:20:21 +02:00
parent eeb711f5f3
commit 28edf2d0f0
2 changed files with 9 additions and 0 deletions

View File

@ -1988,6 +1988,8 @@ Property list
This gives the number bytes per seconds over a 1 second window (using
the type ``MPV_FORMAT_INT64`` for the client API).
This is the same as ``demuxer-cache-state/raw-input-rate``.
``demuxer-cache-duration``
Approximate duration of video buffered in the demuxer, in seconds. The
guess is very unreliable, and often the property will not be available
@ -2035,6 +2037,10 @@ Property list
``cache-duration`` is ``demuxer-cache-duration``. Missing if unavailable.
``raw-input-rate`` is the estimated input rate of the network layer (or any
other byte-oriented input layer) in bytes per second. May be inaccurate or
missing.
When querying the property with the client API using ``MPV_FORMAT_NODE``,
or with Lua ``mp.get_property_native``, this will return a mpv_node with
the following contents:
@ -2051,6 +2057,7 @@ Property list
"fw-bytes" MPV_FORMAT_INT64
"file-cache-bytes" MPV_FORMAT_INT64
"cache-duration" MPV_FORMAT_DOUBLE
"raw-input-rate" MPV_FORMAT_INT64
Other fields (might be changed or removed in the future):

View File

@ -1441,6 +1441,8 @@ static int mp_property_demuxer_cache_state(void *ctx, struct m_property *prop,
node_map_add_int64(r, "fw-bytes", s.fw_bytes);
if (s.file_cache_bytes >= 0)
node_map_add_int64(r, "file-cache-bytes", s.file_cache_bytes);
if (s.bytes_per_second > 0)
node_map_add_int64(r, "raw-input-rate", s.bytes_per_second);
if (s.seeking != MP_NOPTS_VALUE)
node_map_add_double(r, "debug-seeking", s.seeking);
node_map_add_int64(r, "debug-low-level-seeks", s.low_level_seeks);