[FFmpeg-devel] [PATCH 14/14] lavfi/vf_yadif: use standard options parsing.

Nicolas George nicolas.george at normalesup.org
Sat Mar 16 21:39:34 CET 2013


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/vf_yadif.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 7905aae..016a532 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -424,14 +424,6 @@ static int query_formats(AVFilterContext *ctx)
 static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     YADIFContext *yadif = ctx->priv;
-    static const char *shorthand[] = { "mode", "parity", "deint", NULL };
-    int ret;
-
-    yadif->class = &yadif_class;
-    av_opt_set_defaults(yadif);
-
-    if ((ret = av_opt_set_from_string(yadif, args, shorthand, "=", ":")) < 0)
-        return ret;
 
     av_log(ctx, AV_LOG_VERBOSE, "mode:%d parity:%d deint:%d\n",
            yadif->mode, yadif->parity, yadif->deint);
@@ -491,6 +483,8 @@ static const AVFilterPad avfilter_vf_yadif_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = { "mode", "parity", "deint", NULL };
+
 AVFilter avfilter_vf_yadif = {
     .name          = "yadif",
     .description   = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),
@@ -504,4 +498,5 @@ AVFilter avfilter_vf_yadif = {
     .outputs   = avfilter_vf_yadif_outputs,
 
     .priv_class = &yadif_class,
+    .shorthand = shorthand,
 };
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list