From 70df1608d6f74f3eba9a5e593822984194f63951 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 16 Nov 2015 22:47:17 +0100 Subject: player: handle rebasing start time differently Most of this is explained in the DOCS additions. This gives us slightly more sanity, because there is less interaction between the various parts. The goal is getting rid of the video_offset entirely. The simplification extends to the user API. In particular, we don't need to fix missing parts in the API, such as the lack for a seek command that seeks relatively to the start time. All these things are now transparent. (If someone really wants to know the real timestamps/start time, new properties would have to be added.) --- player/command.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index eadcc27296..2e29f994de 100644 --- a/player/command.c +++ b/player/command.c @@ -658,11 +658,8 @@ static int mp_property_percent_pos(void *ctx, struct m_property *prop, static int mp_property_time_start(void *ctx, struct m_property *prop, int action, void *arg) { - MPContext *mpctx = ctx; - double start = get_start_time(mpctx); - if (start < 0) - return M_PROPERTY_UNAVAILABLE; - return property_time(action, arg, start); + // minor backwards-compat. + return property_time(action, arg, 0); } /// Current position in seconds (RW) @@ -723,8 +720,7 @@ static int mp_property_playback_time(void *ctx, struct m_property *prop, return M_PROPERTY_UNAVAILABLE; if (action == M_PROPERTY_SET) { - double target = get_start_time(mpctx) + *(double *)arg; - queue_seek(mpctx, MPSEEK_ABSOLUTE, target, MPSEEK_DEFAULT, true); + queue_seek(mpctx, MPSEEK_ABSOLUTE, *(double *)arg, MPSEEK_DEFAULT, true); return M_PROPERTY_OK; } return property_time(action, arg, get_playback_time(mpctx)); -- cgit v1.2.3