summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-10-16 09:14:20 -0500
committerDudemanguy <random342@airmail.cc>2023-10-16 09:14:20 -0500
commit9d3e607cf749b7be057ba8f30ffd3d55c695a70b (patch)
tree6447344d1588a51cef8499aff8f635270f22ef79
parent056072bf958ffeaadd2f5a69e37f3079f18d4ead (diff)
downloadmpv-9d3e607cf749b7be057ba8f30ffd3d55c695a70b.tar.bz2
mpv-9d3e607cf749b7be057ba8f30ffd3d55c695a70b.tar.xz
command: unbreak runtime play-dir changes
The whole mess with setting the option value explictly and saving the old stop_play value only needs to happen if we're at the end of file. Doing it in general is unneccessary and breaks other things. Fixes #12424.
-rw-r--r--player/command.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/player/command.c b/player/command.c
index 3c069072f3..b2ebb86b18 100644
--- a/player/command.c
+++ b/player/command.c
@@ -7064,14 +7064,16 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
if (opt_ptr == &opts->play_dir) {
if (mpctx->play_dir != opts->play_dir) {
- // Some weird things for play_dir.
+ // Some weird things for play_dir if we're at EOF.
// 1. The option must be set before we seek.
// 2. queue_seek can change the stop_play value; always keep the old one.
- mpctx->play_dir = opts->play_dir;
int old_stop_play = mpctx->stop_play;
+ if (old_stop_play == AT_END_OF_FILE)
+ mpctx->play_dir = opts->play_dir;
queue_seek(mpctx, MPSEEK_ABSOLUTE, get_current_time(mpctx),
MPSEEK_EXACT, 0);
- mpctx->stop_play = old_stop_play;
+ if (old_stop_play == AT_END_OF_FILE)
+ mpctx->stop_play = old_stop_play;
}
}