summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c7
1 files changed, 5 insertions, 2 deletions
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(&param, "-");
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;
}