1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-13 10:26:09 +00:00

m_option: add mechanism to allow inf/-inf float options

Used by the next commit.
This commit is contained in:
wm4 2016-08-17 21:48:45 +02:00
parent 3a7e86ff6e
commit 07f8b64754

View File

@ -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;
}