Skip to content

Commit

Permalink
options: default to --prefetch-playlist=yes
Browse files Browse the repository at this point in the history
--prefetch-playlist improves performance by starting to read the next
file in the last second or playback or while viewing an image. This is
obviously noticeable with playlists of direct media URLs, but can also
make a difference on local slow hardware, mainly large (in bytes) images
on HDDs. You can easily see the difference with 10+ MB images.

Since e7a2536 and 24db17d fixed niche issues, and it's known not
to cause other issues by users using since 2017 who haven't reported
issues, enable it by default to improve performance.

The only flaw is that it doesn't support ytdl-hook URLs, so in Youtube
playlist, it does a web request with ffmpeg that is doomed to fail since
the last second of playback, though this doesn't cause practical
disadvantages.
  • Loading branch information
guidocella committed Feb 3, 2025
1 parent 5610745 commit f88faee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions DOCS/interface-changes/prefetch-playlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
change `--prefetch-playlist`'s default to `yes`
2 changes: 1 addition & 1 deletion DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4186,7 +4186,7 @@ Demuxer

``--prefetch-playlist=<yes|no>``
Prefetch next playlist entry while playback of the current entry is ending
(default: no).
(default: yes).

This does not prefill the cache with the video data of the next URL.
Prefetching video data is supported only for the current playlist entry,
Expand Down
1 change: 1 addition & 0 deletions options/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ static const struct MPOpts mp_default_opts = {
.demuxer_thread = true,
.demux_termination_timeout = 0.1,
.hls_bitrate = INT_MAX,
.prefetch_open = true,
.cache_pause = true,
.cache_pause_wait = 1.0,
.ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE},
Expand Down

0 comments on commit f88faee

Please sign in to comment.