From 85576f31a9cc25ca75ac7d265aaaf211f76a4842 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 28 Feb 2020 15:41:45 +0100 Subject: player: attempt to fix playback end on hr-seeking past EOF again This tries to fix #7206 (hr-seeking past EOF does not stop playback) again. Commit 57fbc9cd76f7 should have fixed this, but trying it again (using that git revision), it often did not work. Whatever the fuck. So add another dumb special case that will break within weeks. Note that the check in handle_eof() had no effect, since execute_queued_seek() is called later, which cancels EOF in the same case. --- player/playloop.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/player/playloop.c b/player/playloop.c index d1a98be306..6c390a76e2 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -1179,14 +1179,17 @@ static void handle_playback_restart(struct MPContext *mpctx) mp_wakeup_core(mpctx); update_ab_loop_clip(mpctx); MP_VERBOSE(mpctx, "playback restart complete @ %f\n", mpctx->playback_pts); + + // Continuous seeks past EOF => treat as EOF instead of repeating seek. + if (mpctx->seek.type == MPSEEK_RELATIVE && mpctx->seek.amount > 0 && + mpctx->video_status == STATUS_EOF && + mpctx->audio_status == STATUS_EOF) + mpctx->seek = (struct seek_params){0}; } } static void handle_eof(struct MPContext *mpctx) { - if (mpctx->seek.type) - return; - /* Don't quit while paused and we're displaying the last video frame. On the * other hand, if we don't have a video frame, then the user probably seeked * outside of the video, and we do want to quit. */ -- cgit v1.2.3