From d59f4fd3ec141693da4f7f6677aa729e1bb92f4d Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 15 May 2024 10:32:50 -0500 Subject: [PATCH] Revert "player: do not exit when a seek gets queued" In various edge cases, this causes an assertion that was added later in 8816e1117ee65039dbb5700219ba3537d3e5290e to be hit. The actual purpose of the special case is not really clear. mp_seek already will change the mpctx->stop_play value, so there shouldn't be any need to do it in queue_seek. And it is known to cause problems so revert it. Also, remove the special play direction logic that works around this behavior. Fixes #13778. This reverts commit dbdc46c97a32c53d41a19908aa365e7d81025c3e. --- player/command.c | 9 ++------- player/playloop.c | 3 --- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/player/command.c b/player/command.c index 6cfd25b6fa..0d4c0ce9ca 100644 --- a/player/command.c +++ b/player/command.c @@ -7441,16 +7441,11 @@ 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 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. - int old_stop_play = mpctx->stop_play; - if (old_stop_play == AT_END_OF_FILE) + // The option must be set before we seek if we're at EOF. + if (mpctx->stop_play == AT_END_OF_FILE) mpctx->play_dir = opts->play_dir; queue_seek(mpctx, MPSEEK_ABSOLUTE, get_current_time(mpctx), MPSEEK_EXACT, 0); - if (old_stop_play == AT_END_OF_FILE) - mpctx->stop_play = old_stop_play; } } diff --git a/player/playloop.c b/player/playloop.c index e101f5fe3d..099a1509c1 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -430,9 +430,6 @@ void queue_seek(struct MPContext *mpctx, enum seek_type type, double amount, mp_wakeup_core(mpctx); - if (mpctx->stop_play == AT_END_OF_FILE) - mpctx->stop_play = KEEP_PLAYING; - switch (type) { case MPSEEK_RELATIVE: seek->flags |= flags;