summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-21 19:26:33 +0200
committerwm4 <wm4@nowhere>2017-10-21 19:26:33 +0200
commit719a435d3636c7b848b49f06e6a2ea55e7ee656a (patch)
tree43a62dbeda4ee45ed53e67ebcb2cfe180f8fd8e2 /player
parent83c9f169c411a60bc6e025ce4feb46742690dad3 (diff)
downloadmpv-719a435d3636c7b848b49f06e6a2ea55e7ee656a.tar.bz2
mpv-719a435d3636c7b848b49f06e6a2ea55e7ee656a.tar.xz
demux: add a back buffer and the ability to seek into it
This improves upon the previous commit, and partially rewrites it (and other code). It does: - disable the seeking within cache by default, and add an option to control it - mess with the buffer estimation reporting code, which will most likely lead to funny regressions even if the new features are not enabled - add a back buffer to the packet cache - enhance the seek code so you can seek into the back buffer - unnecessarily change a bunch of other stuff for no reason - fuck up everything and vomit ponies and rainbows This should actually be pretty usable. One thing we should add are some properties to report the proper buffer state. Then the OSC could show a nice buffer range. Also configuration of the buffers could be made simpler. Once this has been tested enough, it can be enabled by default, and might replace the stream cache's byte ringbuffer. In addition it may or may not be possible to keep other buffer ranges when seeking outside of the current range, but that would be much more complex.
Diffstat (limited to 'player')
-rw-r--r--player/command.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/player/command.c b/player/command.c
index f3ab31aec5..3b20ec8f3d 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1696,11 +1696,10 @@ static int mp_property_demuxer_cache_time(void *ctx, struct m_property *prop,
if (demux_control(mpctx->demuxer, DEMUXER_CTRL_GET_READER_STATE, &s) < 1)
return M_PROPERTY_UNAVAILABLE;
- double ts = s.ts_range[1];
- if (ts == MP_NOPTS_VALUE)
+ if (s.ts_max == MP_NOPTS_VALUE)
return M_PROPERTY_UNAVAILABLE;
- return m_property_double_ro(action, arg, ts);
+ return m_property_double_ro(action, arg, s.ts_max);
}
static int mp_property_demuxer_cache_idle(void *ctx, struct m_property *prop,