summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-27 01:13:20 +0200
committerwm4 <wm4@nowhere>2014-08-27 03:39:04 +0200
commit0b428e44829abc4387f051e3c618c1c878b3a838 (patch)
tree994e0580c831642fde1f2ff6918814404c61deae /demux/demux.h
parenta8513f8b37343c27a4abea380ae0aa6bbae3894c (diff)
downloadmpv-0b428e44829abc4387f051e3c618c1c878b3a838.tar.bz2
mpv-0b428e44829abc4387f051e3c618c1c878b3a838.tar.xz
player: redo how stream caching and pausing on low cache works
Add the --cache-secs option, which literally overrides the value of --demuxer-readahead-secs if the stream cache is active. The default value is very high (10 seconds), which means it can act as network cache. Remove the old behavior of trying to pause once the byte cache runs low. Instead, do something similar wit the demuxer cache. The nice thing is that we can guess how many seconds of video it has cached, and we can make better decisions. But for now, apply a relatively naive heuristic: if the cache is below 0.5 secs, pause, and wait until at least 2 secs are available. Note that due to timestamp reordering, the estimated cached duration of video might be inaccurate, depending on the file format. If the file format has DTS, it's easy, otherwise the duration will seemingly jump back and forth.
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/demux/demux.h b/demux/demux.h
index 92ef461077..d0f70c6f57 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -54,6 +54,12 @@ enum demux_ctrl {
DEMUXER_CTRL_RESYNC,
DEMUXER_CTRL_IDENTIFY_PROGRAM,
DEMUXER_CTRL_STREAM_CTRL,
+ DEMUXER_CTRL_GET_READER_STATE,
+};
+
+struct demux_ctrl_reader_state {
+ bool eof, underrun, idle;
+ double ts_range[2]; // start, end
};
struct demux_ctrl_stream_ctrl {