diff options
author | wm4 <wm4@nowhere> | 2017-01-19 08:00:19 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-19 08:00:19 +0100 |
commit | 880bf54d7e7151875c373f3b749b1f47aeb9a87c (patch) | |
tree | 46c85b1dcd10ecd97c318cf3d695f364c44687b0 /demux/demux.c | |
parent | 06c8ec27f61a6958cb4eb32b18d24bc5686e6c8e (diff) | |
download | mpv-880bf54d7e7151875c373f3b749b1f47aeb9a87c.tar.bz2 mpv-880bf54d7e7151875c373f3b749b1f47aeb9a87c.tar.xz |
player: actually let cache readahead after opening demuxer for prefetch
Disabling cache readahead by default until at least 1 track is selected
is mainly for external files and such, where you don't want them to use
up resources until they're actually used.
It doesn't make sense to disable the cache for the demuxer opened for
prefetch. Also, it's fine to let it do that for the main file too (doing
or not doing it is of little consequence). That saves us from having to
distinguish them.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 3 |
1 files changed, 2 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) { |