options: reset some options between files by default - #14151
Conversation
|
Download the artifacts for this pull request: |
This purely depends on the contents of the playlist in question. It's very often that all videos in the playlist come from closely-related sources. I don't want the crop and rotate settings to be reset for this reason. Switching to the next file and then switching it back also causes the settings to be reset. Also it makes no sense to reset ab loop points without also resetting |
4879430 to
966a267
Compare
|
I always wanted to reset rotate and crop to reset between files, it's hard to guess how common the use case you mentioned is. We can remove those and add ab-loop only if desired. Resetting ab-loop is also nice because it is not obvious how to add it to A tricky one is and IRC discussions: 2023-09-18 17:47:53 ChH guido: kasper93: I didn't realize how weird loop-file is, I've always only used it with yes/no. I thought resetting it means that if mpv gets started without it and then set to 'yes' at runtime, then resetting it would mean it goes to 'no' when going to the next file. |
Add ab-loop options to --reset-on-next-file's default value because you never want to preserve them between files. VLC and MPC-HC also reset them.
966a267 to
83d583e
Compare
|
I made this ab loop only which should be uncontroversial. |
|
Do we really need this change? Are we fixing anything? I can image |
|
That would be weird since episodes have different durations, but it's fine if the change is not worth it. |
| "ab-loop-a", | ||
| "ab-loop-b", | ||
| "ab-loop-count", |
There was a problem hiding this comment.
What's so special about ab-loop? As opposed to dozen other properties that shouldn't be preserved between files? Do you plan to list them all here?
Also user can use file-local-options probably too.
There was a problem hiding this comment.
That it makes no sense to preserve loop points because after changing file they will refer to completely different scenes.
There was a problem hiding this comment.
Same as dozen different options, that are file specific.
There was a problem hiding this comment.
I don't see how any other option is as file specific.
There was a problem hiding this comment.
Yes.
All options in default --watch-later-options are pretty file specific. There is nothing that makes ab loop option different from others.
There was a problem hiding this comment.
I definitely wanted to preserve the options in --watch-later-options for different files except pan and crop, which autocrop.lua already sets locally. Never for ab loops.
|
This works too alternatively. diff --git a/player/command.c b/player/command.c
index d6f7bfd50e..d78d564a7b 100644
--- a/player/command.c
+++ b/player/command.c
@@ -6974,10 +6974,10 @@ static void cmd_ab_loop(void *p)
double now = get_current_time(mpctx);
if (mpctx->opts->ab_loop[0] == MP_NOPTS_VALUE) {
- mp_property_do("ab-loop-a", M_PROPERTY_SET, &now, mpctx);
+ mp_property_do("file-local-options/ab-loop-a", M_PROPERTY_SET, &now, mpctx);
show_property_osd(mpctx, "ab-loop-a", cmd->on_osd);
} else if (mpctx->opts->ab_loop[1] == MP_NOPTS_VALUE) {
- mp_property_do("ab-loop-b", M_PROPERTY_SET, &now, mpctx);
+ mp_property_do("file-local-options/ab-loop-b", M_PROPERTY_SET, &now, mpctx);
show_property_osd(mpctx, "ab-loop-b", cmd->on_osd);
} else {
now = MP_NOPTS_VALUE; |
Add some options to --reset-on-next-file's default value that you commonly don't want to keep between files. The catch is that if you specify options in the command line or mpv.conf --reset-on-next-file resets to those values, but the vast majority of uses for these options should be at runtime.
Fixes #17953.