summaryrefslogtreecommitdiffstats
path: root/options/options.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-16 17:07:36 +0200
committerwm4 <wm4@nowhere>2014-08-16 17:10:08 +0200
commitb822faa6cfdae2c530d68f257a811c6184d237a6 (patch)
tree073cee68af958d205b00648cfacc4439b6d5d471 /options/options.c
parente6e3bc7cd97e7dc27d91bbf89902191b4408cb40 (diff)
downloadmpv-b822faa6cfdae2c530d68f257a811c6184d237a6.tar.bz2
mpv-b822faa6cfdae2c530d68f257a811c6184d237a6.tar.xz
demux: add option to control the readahead buffer by a duration value
--demuxer-readahead-secs now controls how much the demuxer should readahead by an amount of seconds. This is based on the raw packet timestamps. It's not always very exact. For example, h264 in Matroska does not store any linear timestamps (only PTS values which are going to be reordered by the decoder), so this heuristic is usually off by several hundred milliseconds. The decision whether to readahead is basically OR-ed with the other --demuxer-readahead-packets options. Change the manpage descriptions to subtly convey these semantics.
Diffstat (limited to 'options/options.c')
-rw-r--r--options/options.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c
index aacb1b725a..c96f6578b6 100644
--- a/options/options.c
+++ b/options/options.c
@@ -216,6 +216,7 @@ const m_option_t mp_opts[] = {
OPT_STRING("audio-demuxer", audio_demuxer_name, 0),
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
OPT_FLAG("demuxer-thread", demuxer_thread, 0),
+ OPT_DOUBLE("demuxer-readahead-secs", demuxer_min_secs, M_OPT_MIN, .min = 0),
OPT_INTRANGE("demuxer-readahead-packets", demuxer_min_packs, 0, 0, MAX_PACKS),
OPT_INTRANGE("demuxer-readahead-bytes", demuxer_min_bytes, 0, 0, MAX_PACK_BYTES),
@@ -600,6 +601,7 @@ const struct MPOpts mp_default_opts = {
.demuxer_thread = 0,
.demuxer_min_packs = MIN_PACKS,
.demuxer_min_bytes = MIN_PACK_BYTES,
+ .demuxer_min_secs = 0.2,
.network_rtsp_transport = 2,
.chapterrange = {-1, -1},
.edition_id = -1,