player: don't decrement --loop-file=N and add remaining-file-loops

This stops decreasing numerical values of --loop-file on each iteration
so that loop-file=N loops every playlist entry without having to add
--loop-file to --reset-on-next-file.

The current behavior confuses users as seen in:

https://github.com/mpv-player/mpv/issues/2481
https://github.com/mpv-player/mpv/issues/5943
https://github.com/mpv-player/mpv/issues/11291
https://github.com/mpv-player/mpv/issues/13860
https://www.reddit.com/r/mpv/comments/rcwnrw/looping_each_file_n_times_in_a_playlist/

Also options are supposed to reflect the value configured by the user
and not change on their own.

A remaining-file-loops property is exposed as a replacement to check how
many loops are left.
This commit is contained in:
Guido Cella authored and Kacper Michajłow committed 2024-07-26 20:09:19 +02:00
1 parent 397212ae15
commit f411f3145b
6 files changed
+30 -5

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
numerical values of `--loop-file` no longer decrease on each iteration
add `remaining-file-loops` property as a replacement to get the remaining loop count
+6
View File
@@ -2142,6 +2142,12 @@ Property list
``playback-time/full``
``playback-time`` with milliseconds.
``remaining-file-loops``
How many more times the current file is going to be looped. This is
initialized from the value of ``--loop-file``. This counts the number of
times it causes the player to seek to the beginning of the file, so it is 0
the last the time is played. -1 corresponds to infinity.
``chapter`` (RW)
Current chapter number. The number of the first chapter is 0.