Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadfile: fix --loop-playlist=N with --prefetch-playlist #15296

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

guidocella
Copy link
Contributor

@guidocella guidocella commented Nov 11, 2024

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 adding a flag to mp_next_file() to specify whether to decrement --loop-playlist=N. The first playlist entry is still prefetched when it's the next one, but without decrementing --loop-playlist=N.

Copy link

github-actions bot commented Nov 11, 2024

Download the artifacts for this pull request:

Windows
macOS

@guidocella guidocella force-pushed the prefetch-loop branch 2 times, most recently from 791dfcd to 065933f Compare November 12, 2024 09:34
With --prefetch-playlist and --loop-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 adding a flag to mp_next_file() to specify whether to
decrement --loop-playlist=N. The first playlist entry is still
prefetched when it's the next one, but without decrementing
--loop-playlist=N.
There is no need to call mp_next_file() is prefetching already started
so return earlier.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant