diff options
author | wm4 <wm4@nowhere> | 2016-04-18 21:32:58 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-04-18 21:33:19 +0200 |
commit | 382bafcb1349855c2871bbe0a813f8493e1bd9f7 (patch) | |
tree | ec030defef7859e8bfcea89f8d347daa3fea716b /player/command.c | |
parent | ce153bdb428a47d5e26b84d7a1b757fd5f315c59 (diff) | |
download | mpv-382bafcb1349855c2871bbe0a813f8493e1bd9f7.tar.bz2 mpv-382bafcb1349855c2871bbe0a813f8493e1bd9f7.tar.xz |
player: loop on end of file if ab-loop-b is unset
Possibly slightly more useful/intuitive.
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c index e3a3313f79..cdadafa892 100644 --- a/player/command.c +++ b/player/command.c @@ -5245,12 +5245,13 @@ void handle_ab_loop(struct MPContext *mpctx) struct MPOpts *opts = mpctx->opts; 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) - { + if (now != MP_NOPTS_VALUE && opts->ab_loop[0] != MP_NOPTS_VALUE) { + double end = opts->ab_loop[1]; + if (end == MP_NOPTS_VALUE) + end = INFINITY; if (ctx->prev_pts >= opts->ab_loop[0] && - ctx->prev_pts < opts->ab_loop[1] && - (now >= opts->ab_loop[1] || mpctx->stop_play == AT_END_OF_FILE)) + ctx->prev_pts < end && + (now >= end || mpctx->stop_play == AT_END_OF_FILE)) { mark_seek(mpctx); queue_seek(mpctx, MPSEEK_ABSOLUTE, opts->ab_loop[0], |