diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-03-24 11:45:32 +0400 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-24 15:26:24 +0400 |
commit | 8b994c8c1cd754f6fb9bd751d2245ff8497a885c (patch) | |
tree | f24b718e59f3aa87b189d145b5bea4a38df18d42 /libavfilter | |
parent | f7324c068f48ce57226a11d86323f5ae70fcc5b8 (diff) |
lavfi/select: use standard options parsing.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/f_select.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index 603fad39c0..351b7f8d80 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -149,15 +149,8 @@ static const AVOption options[] = { static av_cold int init(AVFilterContext *ctx, const char *args, const AVClass *class) { SelectContext *select = ctx->priv; - const char *shorthand[] = { "expr", NULL }; int ret; - select->class = class; - av_opt_set_defaults(select); - - if ((ret = av_opt_set_from_string(select, args, shorthand, "=", ":")) < 0) - return ret; - if ((ret = av_expr_parse(&select->expr, select->expr_str, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) { av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n", select->expr_str); @@ -373,7 +366,6 @@ static av_cold void uninit(AVFilterContext *ctx) av_expr_free(select->expr); select->expr = NULL; - av_opt_free(select); #if CONFIG_AVCODEC if (select->do_scene_detect) { @@ -402,6 +394,8 @@ static int query_formats(AVFilterContext *ctx) return 0; } +static const char *const shorthand[] = { "expr", NULL }; + #if CONFIG_ASELECT_FILTER #define aselect_options options @@ -451,6 +445,7 @@ AVFilter avfilter_af_aselect = { .inputs = avfilter_af_aselect_inputs, .outputs = avfilter_af_aselect_outputs, .priv_class = &aselect_class, + .shorthand = shorthand, }; #endif /* CONFIG_ASELECT_FILTER */ @@ -507,5 +502,6 @@ AVFilter avfilter_vf_select = { .inputs = avfilter_vf_select_inputs, .outputs = avfilter_vf_select_outputs, .priv_class = &select_class, + .shorthand = shorthand, }; #endif /* CONFIG_SELECT_FILTER */ |