summaryrefslogtreecommitdiff
path: root/libavfilter/vf_decimate.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-03-16 21:08:06 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-03-20 21:13:56 +0100
commit40ecd44f00dc5e10db36b87cd7f728da13256ba2 (patch)
tree4f72e544b941f455bc37b0fd4714e41b6929bd04 /libavfilter/vf_decimate.c
parent6202cf5dd8095abbdf1930faf09900edecafcda4 (diff)
lavfi/vf_decimate: use standard options parsing.
Diffstat (limited to 'libavfilter/vf_decimate.c')
-rw-r--r--libavfilter/vf_decimate.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c
index f0e49c993f..630f3ba492 100644
--- a/libavfilter/vf_decimate.c
+++ b/libavfilter/vf_decimate.c
@@ -132,14 +132,6 @@ static int decimate_frame(AVFilterContext *ctx,
static av_cold int init(AVFilterContext *ctx, const char *args)
{
DecimateContext *decimate = ctx->priv;
- static const char *shorthand[] = { "max", "hi", "lo", "frac", NULL };
- int ret;
-
- decimate->class = &decimate_class;
- av_opt_set_defaults(decimate);
-
- if ((ret = av_opt_set_from_string(decimate, args, shorthand, "=", ":")) < 0)
- return ret;
av_log(ctx, AV_LOG_VERBOSE, "max_drop_count:%d hi:%d lo:%d frac:%f\n",
decimate->max_drop_count, decimate->hi, decimate->lo, decimate->frac);
@@ -157,7 +149,6 @@ static av_cold void uninit(AVFilterContext *ctx)
DecimateContext *decimate = ctx->priv;
av_frame_free(&decimate->ref);
avcodec_close(decimate->avctx);
- av_opt_free(decimate);
av_freep(&decimate->avctx);
}
@@ -251,6 +242,8 @@ static const AVFilterPad decimate_outputs[] = {
{ NULL }
};
+static const char *const shorthand[] = { "max", "hi", "lo", "frac", NULL };
+
AVFilter avfilter_vf_decimate = {
.name = "decimate",
.description = NULL_IF_CONFIG_SMALL("Remove near-duplicate frames."),
@@ -262,4 +255,5 @@ AVFilter avfilter_vf_decimate = {
.inputs = decimate_inputs,
.outputs = decimate_outputs,
.priv_class = &decimate_class,
+ .shorthand = shorthand,
};