summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/input.rst6
-rw-r--r--player/command.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index 049b221758..c49587eabf 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -933,8 +933,10 @@ Property list
``playtime-remaining``
``time-remaining`` scaled by the current ``speed``.
-``playback-time``
- Return the playback time, which is the time difference between start PTS and current PTS.
+``playback-time`` (RW)
+ The playback time, which is the time relative to playback start. (This can
+ be different from the ``time-pos`` property if the file does not start at
+ position ``0``, in which case ``time-pos`` is the source timestamp.)
``chapter`` (RW)
Current chapter number. The number of the first chapter is 0.
diff --git a/player/command.c b/player/command.c
index a74cde2b23..8514be98f7 100644
--- a/player/command.c
+++ b/player/command.c
@@ -686,6 +686,11 @@ static int mp_property_playback_time(void *ctx, struct m_property *prop,
if (!mpctx->playback_initialized)
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);
+ return M_PROPERTY_OK;
+ }
return property_time(action, arg, get_playback_time(mpctx));
}