Skip to content

Commit 791dfcd

Browse files
committed
loadfile: fix --loop-playlist=N with --prefetch-playlist
With --prefetch-playlist, mp_next_file() is called continously since the last second of playback or when viewing an image, which decreases --loop-playlist=N to 1. Fix this by returning before calling mp_next_file() if prefetching already started.
1 parent ca7aeb7 commit 791dfcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

player/loadfile.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1250,11 +1250,11 @@ static void open_demux_reentrant(struct MPContext *mpctx)
12501250

12511251
void prefetch_next(struct MPContext *mpctx)
12521252
{
1253-
if (!mpctx->opts->prefetch_open)
1253+
if (!mpctx->opts->prefetch_open || mpctx->open_active)
12541254
return;
12551255

12561256
struct playlist_entry *new_entry = mp_next_file(mpctx, +1, false);
1257-
if (new_entry && !mpctx->open_active && new_entry->filename) {
1257+
if (new_entry && new_entry->filename) {
12581258
MP_VERBOSE(mpctx, "Prefetching: %s\n", new_entry->filename);
12591259
start_open(mpctx, new_entry->filename, new_entry->stream_flags, true);
12601260
}

0 commit comments

Comments
 (0)