From a6ca1677941b817cce401eb4d75f9c049b789b55 Mon Sep 17 00:00:00 2001 From: Leo Izen Date: Sun, 3 Dec 2017 20:26:42 -0500 Subject: player: add get_play_start_pts Added a get_play_start_pts function to coincide with the already-existing get_play_end_pts. This prevents code duplication and also serves to make it so code that probes the start time (such as get_current_pos_ratio) will work correctly with chapters. Included is a bug fix for misc.c/rel_time_to_abs that makes it work correctly with chapters when --rebase-start-time=no is set. --- player/playloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index c53dd0fed0..2d1db03867 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -482,7 +482,7 @@ double get_current_pos_ratio(struct MPContext *mpctx, bool use_range) double start = 0; double len = get_time_length(mpctx); if (use_range) { - double startpos = rel_time_to_abs(mpctx, mpctx->opts->play_start); + double startpos = get_play_start_pts(mpctx); double endpos = get_play_end_pts(mpctx); if (endpos == MP_NOPTS_VALUE || endpos > MPMAX(0, len)) endpos = MPMAX(0, len); -- cgit v1.2.3