diff options
author | wm4 <wm4@nowhere> | 2019-05-27 01:46:34 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:05 +0200 |
commit | c7269e4e84f4d0a0709a560acbfe2fa3b02a5527 (patch) | |
tree | 696322ad37985d511a2c9f82561a751e9923797d /player/misc.c | |
parent | 878d4ea2ee22cc8d11652aee0fe144ca3f6ae131 (diff) | |
download | mpv-c7269e4e84f4d0a0709a560acbfe2fa3b02a5527.tar.bz2 mpv-c7269e4e84f4d0a0709a560acbfe2fa3b02a5527.tar.xz |
player: fix --loop with backward playback
Obviously should seek back to the end of the file when it loops.
Also remove some minor code duplication around start times. This isn't
the correct solution by the way. Rather than hoping we know a reasonable
start/end time, this stuff should instruct the demuxer to seek to the
exact location. It'll work with 99% of all normal files, but add an
appropriate comment (that basically says the function is bullshit) to
get_start_time() anyway.
Diffstat (limited to 'player/misc.c')
-rw-r--r-- | player/misc.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/player/misc.c b/player/misc.c index a39c8df82b..b9a280f2cc 100644 --- a/player/misc.c +++ b/player/misc.c @@ -107,14 +107,8 @@ double get_play_start_pts(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; double res = rel_time_to_abs(mpctx, opts->play_start); - if (res == MP_NOPTS_VALUE) { - res = 0; - if (!opts->rebase_start_time && mpctx->demuxer) - res = mpctx->demuxer->start_time; - // Backward playback -> start from end by default. - if (mpctx->play_dir < 0 && mpctx->demuxer) - res = MPMAX(mpctx->demuxer->duration, 0); - } + if (res == MP_NOPTS_VALUE) + res = get_start_time(mpctx, mpctx->play_dir); return res; } |