diff options
author | wm4 <wm4@nowhere> | 2016-04-28 22:46:49 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-04-28 22:46:49 +0200 |
commit | 0ed206abd94641ab44f4693169fbbbd8a33fa121 (patch) | |
tree | c2d8f75ac8bcacf84e4e6efef016aa8c554d6948 | |
parent | d30634b104ee80fdda0829009cf4aca2424b0414 (diff) |
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.
-rw-r--r-- | player/command.c | 10 |
1 files changed, 5 insertions, 5 deletions
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)) |