mirror of
https://github.com/mpv-player/mpv.git
synced 2026-05-07 20:02:49 +00:00
cb91de2a34
Setting this to M_RANGE(-1, 10) meant that you could pass fractional negative values without it being an error. This is, of course, nonsense. -1 is the only special negative value with a meaning. Error out if we get anything else by doing some additional parsing before we send it off to parse_double which will then restrict the range to 0, 10 with these changes. Note that this approach requires defval to be there which is not the most extensible thing in the world. But there's literally only two OPT_ASPECT type options out of the hundreds we have so not a big deal. Ideally, this type should be OPT_CHOICE but with underlying doubles but that's too much effort to implement cleanly.