summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demux/demux.c3
-rw-r--r--demux/demux.h1
-rw-r--r--player/loadfile.c1
3 files changed, 4 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 2195246ac8..824e20d524 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -1305,7 +1305,8 @@ static struct demuxer *open_given_type(struct mpv_global *global,
demux_init_cache(demuxer);
demux_changed(in->d_thread, DEMUX_EVENT_ALL);
demux_update(demuxer);
- stream_control(demuxer->stream, STREAM_CTRL_SET_READAHEAD, &(int){false});
+ stream_control(demuxer->stream, STREAM_CTRL_SET_READAHEAD,
+ &(int){params ? params->initial_readahead : false});
if (!(params && params->disable_timeline)) {
struct timeline *tl = timeline_load(global, log, demuxer);
if (tl) {
diff --git a/demux/demux.h b/demux/demux.h
index 0e5a5e15c6..f9d98e5cef 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -162,6 +162,7 @@ struct demuxer_params {
bool *matroska_was_valid;
struct timeline *timeline;
bool disable_timeline;
+ bool initial_readahead;
// -- demux_open_url() only
int stream_flags;
bool allow_capture;
diff --git a/player/loadfile.c b/player/loadfile.c
index daccfed7c4..69647d8929 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -798,6 +798,7 @@ static void *open_demux_thread(void *ctx)
.force_format = mpctx->open_format,
.allow_capture = true,
.stream_flags = mpctx->open_url_flags,
+ .initial_readahead = true,
};
mpctx->open_res_demuxer =
demux_open_url(mpctx->open_url, &p, mpctx->open_cancel, mpctx->global);