diff options
author | wm4 <wm4@nowhere> | 2016-08-17 21:48:45 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-17 21:48:56 +0200 |
commit | 07f8b647547cadb61d0677200faeaf1498b8377e (patch) | |
tree | fb131ba7c1381396c504d2e7f47fa133ec9ba55c | |
parent | 3a7e86ff6efc834281d3f112b05a82fc6b2e1023 (diff) | |
download | mpv-07f8b647547cadb61d0677200faeaf1498b8377e.tar.bz2 mpv-07f8b647547cadb61d0677200faeaf1498b8377e.tar.xz |
m_option: add mechanism to allow inf/-inf float options
Used by the next commit.
-rw-r--r-- | options/m_option.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/options/m_option.c b/options/m_option.c index 4dedfe476e..0acdc55b0a 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -894,7 +894,8 @@ static int clamp_double(const m_option_t *opt, void *val) v = opt->min; r = M_OPT_OUT_OF_RANGE; } - if (!isfinite(v)) { + // (setting max/min to INFINITY/-INFINITY is allowed) + if (!isfinite(v) && v != opt->max && v != opt->min) { v = opt->min; r = M_OPT_OUT_OF_RANGE; } |