diff options
author | wm4 <wm4@nowhere> | 2020-03-13 16:49:39 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-03-13 17:34:46 +0100 |
commit | 8d965a1bfb3782343a03cff44977f11bb920f0b1 (patch) | |
tree | 2d115c24510ab36cc9ac7af8dea2b710537561c9 /filters/f_swresample.c | |
parent | 5d5a7e19537a036fe16ce04555e6ce9449c47494 (diff) | |
download | mpv-8d965a1bfb3782343a03cff44977f11bb920f0b1.tar.bz2 mpv-8d965a1bfb3782343a03cff44977f11bb920f0b1.tar.xz |
options: change how option range min/max is handled
Before this commit, option declarations used M_OPT_MIN/M_OPT_MAX (and
some other identifiers based on these) to signal whether an option had
min/max values. Remove these flags, and make it use a range implicitly
on the condition if min<max is true.
This requires care in all cases when only M_OPT_MIN or M_OPT_MAX were
set (instead of both). Generally, the commit replaces all these
instances with using DBL_MAX/DBL_MIN for the "unset" part of the range.
This also happens to fix some cases where you could pass over-large
values to integer options, which were silently truncated, but now cause
an error.
This commit has some higher potential for regressions.
Diffstat (limited to 'filters/f_swresample.c')
-rw-r--r-- | filters/f_swresample.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/filters/f_swresample.c b/filters/f_swresample.c index 0f4033b26a..0197ca9662 100644 --- a/filters/f_swresample.c +++ b/filters/f_swresample.c @@ -74,7 +74,7 @@ const struct m_sub_options resample_conf = { OPT_INTRANGE("audio-resample-filter-size", filter_size, 0, 0, 32), OPT_INTRANGE("audio-resample-phase-shift", phase_shift, 0, 0, 30), OPT_FLAG("audio-resample-linear", linear, 0), - OPT_DOUBLE("audio-resample-cutoff", cutoff, M_OPT_RANGE, + OPT_DOUBLE("audio-resample-cutoff", cutoff, 0, .min = 0, .max = 1), OPT_FLAG("audio-normalize-downmix", normalize, 0), OPT_DOUBLE("audio-resample-max-output-size", max_output_frame_size, 0), |