Skip to content

Commit

Permalink
loadfile: fix --loop-playlist + --shuffle + --prefetch-playlist
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guidocella committed Nov 12, 2024
1 parent 41ab701 commit 879b4cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion player/loadfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,8 +1935,11 @@ struct playlist_entry *mp_next_file(struct MPContext *mpctx, int direction,
next->playlist_prev_attempt = true;
if (!next && mpctx->opts->loop_times != 1) {
if (direction > 0) {
if (mpctx->opts->shuffle)
if (mpctx->opts->shuffle) {
if (!update_loop)
return NULL;
playlist_shuffle(mpctx->playlist);
}
next = playlist_get_first(mpctx->playlist);
if (next && mpctx->opts->loop_times > 1 && update_loop) {
mpctx->opts->loop_times--;
Expand Down

0 comments on commit 879b4cd

Please sign in to comment.