summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index f4fad8a914..c16b8e8152 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1551,6 +1551,11 @@ static void play_current_file(struct MPContext *mpctx)
}
double play_start_pts = get_play_start_pts(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);
+
if (play_start_pts != MP_NOPTS_VALUE) {
/*
* get_play_start_pts returns rebased values, but