From c7269e4e84f4d0a0709a560acbfe2fa3b02a5527 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 27 May 2019 01:46:34 +0200 Subject: 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. --- player/loadfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index e1e0c2c794..c730d2e8f8 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1555,7 +1555,7 @@ static void play_current_file(struct MPContext *mpctx) // Backward playback -> start from end by default. if (play_start_pts == MP_NOPTS_VALUE && opts->play_dir < 0) - play_start_pts = MPMAX(mpctx->demuxer->duration, 0); + play_start_pts = get_start_time(mpctx, -1); if (play_start_pts != MP_NOPTS_VALUE) { queue_seek(mpctx, MPSEEK_ABSOLUTE, play_start_pts, MPSEEK_DEFAULT, 0); -- cgit v1.2.3