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

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


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/vf_unsharp.c |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c
index 0c084a8..6a44643 100644
--- a/libavfilter/vf_unsharp.c
+++ b/libavfilter/vf_unsharp.c
@@ -169,18 +169,6 @@ static void set_filter_param(FilterParam *fp, int msize_x, int msize_y, double a
 static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     UnsharpContext *unsharp = ctx->priv;
-    static const char *shorthand[] = {
-        "luma_msize_x", "luma_msize_y", "luma_amount",
-        "chroma_msize_x", "chroma_msize_y", "chroma_amount",
-        NULL
-    };
-    int ret;
-
-    unsharp->class = &unsharp_class;
-    av_opt_set_defaults(unsharp);
-
-    if ((ret = av_opt_set_from_string(unsharp, args, shorthand, "=", ":")) < 0)
-        return ret;
 
     set_filter_param(&unsharp->luma,   unsharp->luma_msize_x,   unsharp->luma_msize_y,   unsharp->luma_amount);
     set_filter_param(&unsharp->chroma, unsharp->chroma_msize_x, unsharp->chroma_msize_y, unsharp->chroma_amount);
@@ -300,6 +288,12 @@ static const AVFilterPad avfilter_vf_unsharp_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = {
+    "luma_msize_x", "luma_msize_y", "luma_amount",
+    "chroma_msize_x", "chroma_msize_y", "chroma_amount",
+    NULL
+};
+
 AVFilter avfilter_vf_unsharp = {
     .name      = "unsharp",
     .description = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."),
@@ -315,4 +309,5 @@ AVFilter avfilter_vf_unsharp = {
     .outputs   = avfilter_vf_unsharp_outputs,
 
     .priv_class = &unsharp_class,
+    .shorthand = shorthand,
 };
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list