summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-09 11:27:38 +0200
committerwm4 <wm4@nowhere>2020-04-09 11:27:38 +0200
commitbc1a18ee245ec2243d4b7b0fa22894f4326b3758 (patch)
treef8b56c493a058c17bb64ae5b3b77b77003d5d0be /audio
parent823e5205eac66e5bff0953605b5b6c9ddde54739 (diff)
downloadmpv-bc1a18ee245ec2243d4b7b0fa22894f4326b3758.tar.bz2
mpv-bc1a18ee245ec2243d4b7b0fa22894f4326b3758.tar.xz
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.
Diffstat (limited to 'audio')
-rw-r--r--audio/filter/af_format.c6
1 files changed, 4 insertions, 2 deletions
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}
},