[FFmpeg-cvslog] lavfi/field: use standard options parsing.

Clément Bœsch git at videolan.org
Sun Mar 24 12:33:30 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Mar 24 09:01:07 2013 +0100| [a733481d0abc0320297fc3e1f7a57c0fdbcbe526] | committer: Clément Bœsch

lavfi/field: use standard options parsing.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a733481d0abc0320297fc3e1f7a57c0fdbcbe526
---

 libavfilter/vf_field.c |   16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/libavfilter/vf_field.c b/libavfilter/vf_field.c
index fc7e043..eb8680d 100644
--- a/libavfilter/vf_field.c
+++ b/libavfilter/vf_field.c
@@ -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,
 };



More information about the ffmpeg-cvslog mailing list