summaryrefslogtreecommitdiffstats
path: root/player/playloop.c
diff options
context:
space:
mode:
authorTsukasa OMOTO <henry0312@gmail.com>2014-06-30 02:27:46 +0900
committerwm4 <wm4@nowhere>2014-06-29 20:39:49 +0200
commita73415584c9dbf920ec14d26d0b0629cae81b3d5 (patch)
tree52e4bb2911b888f97ba5b3d736235494e89311ce /player/playloop.c
parent7412257305140e5a21a1acd35f6be546b9295dd5 (diff)
downloadmpv-a73415584c9dbf920ec14d26d0b0629cae81b3d5.tar.bz2
mpv-a73415584c9dbf920ec14d26d0b0629cae81b3d5.tar.xz
player: make the time display relative to start PTS
This commit makes the playback start time always at time 0. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'player/playloop.c')
-rw-r--r--player/playloop.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 96326da57c..17df319879 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -426,6 +426,13 @@ double get_current_time(struct MPContext *mpctx)
return 0;
}
+double get_playback_time(struct MPContext *mpctx)
+{
+ double cur = get_current_time(mpctx);
+ double start = get_start_time(mpctx);
+ return cur >= start ? cur - start : cur;
+}
+
// Return playback position in 0.0-1.0 ratio, or -1 if unknown.
double get_current_pos_ratio(struct MPContext *mpctx, bool use_range)
{