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
2024-06-04 21:51:03 +02:00
committed by Kacper Michajłow
parent 397212ae15
commit f411f3145b
6 changed files with 30 additions and 5 deletions

View File

@@ -1633,6 +1633,9 @@ static void play_current_file(struct MPContext *mpctx)
load_per_file_options(mpctx->mconfig, mpctx->playing->params,
mpctx->playing->num_params);
mpctx->remaining_file_loops = mpctx->opts->loop_file;
mp_notify_property(mpctx, "remaining-file-loops");
mpctx->max_frames = opts->play_frames;
handle_force_window(mpctx, false);