diff options
Diffstat (limited to 'audio/filter/af_format.c')
-rw-r--r-- | audio/filter/af_format.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/audio/filter/af_format.c b/audio/filter/af_format.c index 3e1eef664c..eddce6422f 100644 --- a/audio/filter/af_format.c +++ b/audio/filter/af_format.c @@ -30,7 +30,7 @@ struct f_opts { int out_srate; struct m_channels out_channels; - int fail; + bool fail; }; struct priv { @@ -38,7 +38,7 @@ struct priv { struct mp_pin *in_pin; }; -static void process(struct mp_filter *f) +static void af_format_process(struct mp_filter *f) { struct priv *p = f->priv; @@ -85,7 +85,7 @@ error: static const struct mp_filter_info af_format_filter = { .name = "format", .priv_size = sizeof(struct priv), - .process = process, + .process = af_format_process, }; static struct mp_filter *af_format_create(struct mp_filter *parent, @@ -128,12 +128,14 @@ const struct mp_user_filter_entry af_format = { .description = "Force audio format", .priv_size = sizeof(struct f_opts), .options = (const struct m_option[]) { - OPT_AUDIOFORMAT("format", in_format, 0), - OPT_INTRANGE("srate", in_srate, 0, 1000, 8*48000), - OPT_CHANNELS("channels", in_channels, 0, .min = 1), - OPT_INTRANGE("out-srate", out_srate, 0, 1000, 8*48000), - OPT_CHANNELS("out-channels", out_channels, 0, .min = 1), - OPT_FLAG("fail", fail, 0), + {"format", OPT_AUDIOFORMAT(in_format)}, + {"srate", OPT_INT(in_srate), M_RANGE(1000, 8*48000)}, + {"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), + .flags = M_OPT_CHANNELS_LIMITED}, + {"fail", OPT_BOOL(fail)}, {0} }, }, |