diff options
author | wm4 <wm4@nowhere> | 2015-11-16 22:47:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-16 22:47:17 +0100 |
commit | 70df1608d6f74f3eba9a5e593822984194f63951 (patch) | |
tree | e6f332aa72d8fd8020d4ba9a214a4826ed6e711f /player/command.c | |
parent | e24e0ccd6828ff8a50fb290bed45a0f6d81eb00b (diff) | |
download | mpv-70df1608d6f74f3eba9a5e593822984194f63951.tar.bz2 mpv-70df1608d6f74f3eba9a5e593822984194f63951.tar.xz |
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.)
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 10 |
1 files changed, 3 insertions, 7 deletions
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)); |