From bc1a18ee245ec2243d4b7b0fa22894f4326b3758 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 Apr 2020 11:27:38 +0200 Subject: options: cleanup .min use for OPT_CHANNELS Replace use of .min==1 with a proper flag. This is a good idea, because it has nothing to do with numeric limits (also see commit 9d32d62b61547 for how this can go wrong). With this, m_option.min/max are strictly used for numeric limits. --- audio/filter/af_format.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/filter/af_format.c b/audio/filter/af_format.c index 79d78d1d96..88ae99ed56 100644 --- a/audio/filter/af_format.c +++ b/audio/filter/af_format.c @@ -130,9 +130,11 @@ const struct mp_user_filter_entry af_format = { .options = (const struct m_option[]) { {"format", OPT_AUDIOFORMAT(in_format)}, {"srate", OPT_INT(in_srate), M_RANGE(1000, 8*48000)}, - {"channels", OPT_CHANNELS(in_channels), .min = 1}, + {"channels", OPT_CHANNELS(in_channels), + .flags = M_OPT_CHANNELS_LIMITED}, {"out-srate", OPT_INT(out_srate), M_RANGE(1000, 8*48000)}, - {"out-channels", OPT_CHANNELS(out_channels), .min = 1}, + {"out-channels", OPT_CHANNELS(out_channels), + .flags = M_OPT_CHANNELS_LIMITED}, {"fail", OPT_FLAG(fail)}, {0} }, -- cgit v1.2.3