commit 1: 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.
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.
commit 2: player: don't decrement --ab-loop-count=N and add remaining-ab-loops
Follow up to the previous commit. Stop decreasing --ab-loop-count=N on each iteration so it is preserved across different loops. In particular it is preserved between different files without adding it to --reset-on-next-file. Add a property to expose the remaning A-B loop count instead.
The current behavior of --ab-loop-count=N is even worse than --loop-file since it also doesn't reset when defining a new A-B loop in the same file. Defining it has no effect after --ab-loop-count has decreased to 0, and this can't be fixed by adding it to --reset-on-next-file. This commit also resets remaining-ab-loops every time --ab-loop-a and --ab-loop-b are set to fix this.
I didn't add remaining-playlist-loops because --playlist-loop already applies to all files. We also avoid dealing with the inconsistency of --loop-playlist=1 corresponding to 1 playthrough and --loop-file=1 corresponding to 2.
commit 1: 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.
commit 2: player: don't decrement --ab-loop-count=N and add remaining-ab-loops
Follow up to the previous commit. Stop decreasing --ab-loop-count=N on each iteration so it is preserved across different loops. In particular it is preserved between different files without adding it to --reset-on-next-file. Add a property to expose the remaning A-B loop count instead.
The current behavior of --ab-loop-count=N is even worse than --loop-file since it also doesn't reset when defining a new A-B loop in the same file. Defining it has no effect after --ab-loop-count has decreased to 0, and this can't be fixed by adding it to --reset-on-next-file. This commit also resets remaining-ab-loops every time --ab-loop-a and --ab-loop-b are set to fix this.
I didn't add
remaining-playlist-loops
because--playlist-loop
already applies to all files. We also avoid dealing with the inconsistency of--loop-playlist=1
corresponding to 1 playthrough and--loop-file=1
corresponding to 2.