]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/af_channelsplit.c
Merge commit '97bf7c03b1338a867da52c159a2afecbdedcfa88'
[ffmpeg] / libavfilter / af_channelsplit.c
index e8ceb9c016c7c1ac3f263db69497c237713c086e..65bbaa67d097f5120cb151a452a9f2810362cf5e 100644 (file)
@@ -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,
 };