From 8565073f6825e8ea9b2b9b120f6995029a7db445 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 21 Aug 2015 15:51:50 +0200 Subject: command: make the playback-time property writable Provides a simplistic way to seek without having to care about weird situations like timestamp vs. playback time. This is good, because the seek command is currently timestamp based, so when using the seek command the user _does_ have to care. --- player/command.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'player') 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)); } -- cgit v1.2.3