summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-25 18:33:17 +0200
committerwm4 <wm4@nowhere>2013-11-02 19:02:21 +0100
commitcc2b5c16fa018987bafa9066890ead11a4c4f34f (patch)
tree43ac4504f8e5d3e156c6d4b433ca2315d2c59afd
parentbf345136b9318f88b551af60cb76f77dec72455f (diff)
downloadmpv-cc2b5c16fa018987bafa9066890ead11a4c4f34f.tar.bz2
mpv-cc2b5c16fa018987bafa9066890ead11a4c4f34f.tar.xz
mplayer: make --length relative to actual start of file, instead of 0
We always use the file's timestamps, so the start time can be easily something different from 0. Make the --length option respect this.
-rw-r--r--mpvcore/mplayer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c
index ae692413f0..ba1edda943 100644
--- a/mpvcore/mplayer.c
+++ b/mpvcore/mplayer.c
@@ -240,7 +240,8 @@ static double get_play_end_pts(struct MPContext *mpctx)
if (opts->play_end.type) {
return rel_time_to_abs(mpctx, opts->play_end, MP_NOPTS_VALUE);
} else if (opts->play_length.type) {
- double start = rel_time_to_abs(mpctx, opts->play_start, 0);
+ double startpts = get_start_time(mpctx);
+ double start = rel_time_to_abs(mpctx, opts->play_start, startpts);
double length = rel_time_to_abs(mpctx, opts->play_length, -1);
if (start != -1 && length != -1)
return start + length;