diff options
Diffstat (limited to 'libavfilter/af_channelsplit.c')
-rw-r--r-- | libavfilter/af_channelsplit.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c index 92fb27e..56950c8 100644 --- a/libavfilter/af_channelsplit.c +++ b/libavfilter/af_channelsplit.c @@ -41,17 +41,13 @@ typedef struct ChannelSplitContext { #define OFFSET(x) offsetof(ChannelSplitContext, x) #define A AV_OPT_FLAG_AUDIO_PARAM -static const AVOption options[] = { - { "channel_layout", "Input channel layout.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, { .str = "stereo" }, .flags = A }, +#define F AV_OPT_FLAG_FILTERING_PARAM +static const AVOption channelsplit_options[] = { + { "channel_layout", "Input channel layout.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, { .str = "stereo" }, .flags = A|F }, { NULL }, }; -static const AVClass channelsplit_class = { - .class_name = "channelsplit filter", - .item_name = av_default_item_name, - .option = options, - .version = LIBAVUTIL_VERSION_INT, -}; +AVFILTER_DEFINE_CLASS(channelsplit); static int init(AVFilterContext *ctx, const char *arg) { @@ -61,10 +57,8 @@ static int init(AVFilterContext *ctx, const char *arg) s->class = &channelsplit_class; av_opt_set_defaults(s); - if ((ret = av_set_options_string(s, arg, "=", ":")) < 0) { - av_log(ctx, AV_LOG_ERROR, "Error parsing options string '%s'.\n", arg); + if ((ret = av_set_options_string(s, arg, "=", ":")) < 0) return ret; - } if (!(s->channel_layout = av_get_channel_layout(s->channel_layout_str))) { av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n", s->channel_layout_str); @@ -155,4 +149,5 @@ AVFilter avfilter_af_channelsplit = { .inputs = avfilter_af_channelsplit_inputs, .outputs = NULL, + .priv_class = &channelsplit_class, }; |