From 0ed206abd94641ab44f4693169fbbbd8a33fa121 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 Apr 2016 22:46:49 +0200 Subject: command: don't seek immediately when setting a-b loop when paused Because it's annoying and feels unnatural. If the B point is set while paused, don't seek. If not paused, it should properly loop immediately. In theory there's a chance that it will show at least 1 frame after the loop point when setting the B point. But let's not care about that. --- player/command.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index 738865bce2..504387c4c1 100644 --- a/player/command.c +++ b/player/command.c @@ -3220,11 +3220,8 @@ static int mp_property_ab_loop(void *ctx, struct m_property *prop, int r = mp_property_generic_option(mpctx, prop, action, arg); if (r > 0 && action == M_PROPERTY_SET) { if (strcmp(prop->name, "ab-loop-b") == 0) { - double now = mpctx->playback_pts; - if (now != MP_NOPTS_VALUE && opts->ab_loop[0] != MP_NOPTS_VALUE && - opts->ab_loop[1] != MP_NOPTS_VALUE && now >= opts->ab_loop[1]) - queue_seek(mpctx, MPSEEK_ABSOLUTE, opts->ab_loop[0], - MPSEEK_EXACT, false); + struct command_ctx *cctx = mpctx->command_ctx; + cctx->prev_pts = opts->ab_loop[0]; } // Update if visible set_osd_bar_chapters(mpctx, OSD_BAR_SEEK); @@ -5245,6 +5242,9 @@ void handle_ab_loop(struct MPContext *mpctx) struct command_ctx *ctx = mpctx->command_ctx; struct MPOpts *opts = mpctx->opts; + if (opts->pause) + return; + double now = mpctx->restart_complete ? mpctx->playback_pts : MP_NOPTS_VALUE; if (now != MP_NOPTS_VALUE && (opts->ab_loop[0] != MP_NOPTS_VALUE || opts->ab_loop[1] != MP_NOPTS_VALUE)) -- cgit v1.2.3