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
19391939 next->playlist_prev_attempt = true;
19401940 if (!next && mpctx->opts->loop_times != 1) {
19411941 if (direction > 0) {
1942− if (mpctx->opts->shuffle)
1942+ if (mpctx->opts->shuffle) {
1943+ if (!update_loop)
1944+ return NULL;
19431945 playlist_shuffle(mpctx->playlist);
1946+ }
19441947 next = playlist_get_first(mpctx->playlist);
19451948 if (next && mpctx->opts->loop_times > 1 && update_loop) {
19461949 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