diff options
author | wm4 <wm4@nowhere> | 2013-10-25 18:33:17 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-25 18:39:15 +0200 |
commit | 607892b741cf8d8f73923cf874ecd7518ed74337 (patch) | |
tree | 0157a7d0e184b439e5364a4ebbb299af1468a1a5 /mpvcore/mplayer.c | |
parent | 2c6f6c9f4e025dc8e6b2e3288485c256d1c48657 (diff) | |
download | mpv-607892b741cf8d8f73923cf874ecd7518ed74337.tar.bz2 mpv-607892b741cf8d8f73923cf874ecd7518ed74337.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.
Diffstat (limited to 'mpvcore/mplayer.c')
-rw-r--r-- | mpvcore/mplayer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index f05fcd9795..35cbbdff58 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; |