From 1aef780b6cd7743df7e21cfb7dc45ad5f99e0825 Mon Sep 17 00:00:00 2001 From: Tsukasa OMOTO Date: Mon, 30 Jun 2014 02:44:32 +0900 Subject: options: support setting start time relative to start PTS Signed-off-by: wm4 --- options/m_option.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'options/m_option.c') diff --git a/options/m_option.c b/options/m_option.c index 04b4783dc1..3baaaa6762 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2181,10 +2181,13 @@ static int parse_rel_time(struct mp_log *log, const m_option_t *opt, } } - bool sign = bstr_eatstart0(¶m, "-"); double time; if (parse_timestring(param, &time, 0)) { - t.type = sign ? REL_TIME_NEGATIVE : REL_TIME_ABSOLUTE; + if (bstr_startswith0(param, "+") || bstr_startswith0(param, "-")) { + t.type = REL_TIME_RELATIVE; + } else { + t.type = REL_TIME_ABSOLUTE; + } t.pos = time; goto out; } -- cgit v1.2.3