History

loadfile: fix --loop-playlist + --shuffle + --prefetch-playlist

With this combination of options, the playlist is shuffled every time the last playlist is reached, instead of when restarting from the first playlist entry. Abort prefetching in this case, as we can't predict which file to prefetch until the playlist is shuffled when actually going to the first file again.

Guido Cella committed 2 years ago

Commit df3872e1 parent 304a6201 file · +4 −1Browse files

Unified · Split

player/loadfile.c+4−1
@@ -1939,8 +1939,11 @@ struct playlist_entry *mp_next_file(struct MPContext *mpctx, int direction, · 1938 unmodified lines
1939 next->playlist_prev_attempt = true;1939 next->playlist_prev_attempt = true;
1940 if (!next && mpctx->opts->loop_times != 1) {1940 if (!next && mpctx->opts->loop_times != 1) {
1941 if (direction > 0) {1941 if (direction > 0) {
1942 if (mpctx->opts->shuffle)1942 if (mpctx->opts->shuffle) {
1943 if (!update_loop)
1944 return NULL;
1943 playlist_shuffle(mpctx->playlist);1945 playlist_shuffle(mpctx->playlist);
1946 }
1944 next = playlist_get_first(mpctx->playlist);1947 next = playlist_get_first(mpctx->playlist);
1945 if (next && mpctx->opts->loop_times > 1 && update_loop) {1948 if (next && mpctx->opts->loop_times > 1 && update_loop) {
1946 mpctx->opts->loop_times--;1949 mpctx->opts->loop_times--;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t