]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/field: use standard options parsing.
authorClément Bœsch <ubitux@gmail.com>
Sun, 24 Mar 2013 08:01:07 +0000 (09:01 +0100)
committerClément Bœsch <ubitux@gmail.com>
Sun, 24 Mar 2013 11:26:24 +0000 (12:26 +0100)
libavfilter/vf_field.c

index fc7e043311718963fb92b753ddabc4af0d5b25a5..eb8680df9ea561ca7aa4a2cae8bfa693cee06bfa 100644 (file)
@@ -50,17 +50,6 @@ static const AVOption field_options[] = {
 
 AVFILTER_DEFINE_CLASS(field);
 
-static av_cold int init(AVFilterContext *ctx, const char *args)
-{
-    FieldContext *field = ctx->priv;
-    static const char *shorthand[] = { "type", NULL };
-
-    field->class = &field_class;
-    av_opt_set_defaults(field);
-
-    return av_opt_set_from_string(field, args, shorthand, "=", ":");
-}
-
 static int config_props_output(AVFilterLink *outlink)
 {
     AVFilterContext *ctx = outlink->src;
@@ -118,14 +107,15 @@ static const AVFilterPad field_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = { "type", NULL };
+
 AVFilter avfilter_vf_field = {
     .name          = "field",
     .description   = NULL_IF_CONFIG_SMALL("Extract a field from the input video."),
 
     .priv_size     = sizeof(FieldContext),
-    .init          = init,
-
     .inputs        = field_inputs,
     .outputs       = field_outputs,
     .priv_class    = &field_class,
+    .shorthand     = shorthand,
 };