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

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


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

diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index 3f4a4f0..1a0e8d7 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -111,14 +111,6 @@ AVFILTER_DEFINE_CLASS(pad);
 static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     PadContext *pad = ctx->priv;
-    static const char *shorthand[] = { "width", "height", "x", "y", "color", NULL };
-    int ret;
-
-    pad->class = &pad_class;
-    av_opt_set_defaults(pad);
-
-    if ((ret = av_opt_set_from_string(pad, args, shorthand, "=", ":")) < 0)
-        return ret;
 
     if (av_parse_color(pad->rgba_color, pad->color_str, -1, ctx) < 0)
         return AVERROR(EINVAL);
@@ -416,6 +408,8 @@ static const AVFilterPad avfilter_vf_pad_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = { "width", "height", "x", "y", "color", NULL };
+
 AVFilter avfilter_vf_pad = {
     .name          = "pad",
     .description   = NULL_IF_CONFIG_SMALL("Pad input image to width:height[:x:y[:color]] (default x and y: 0, default color: black)."),
@@ -429,4 +423,5 @@ AVFilter avfilter_vf_pad = {
 
     .outputs   = avfilter_vf_pad_outputs,
     .priv_class = &pad_class,
+    .shorthand = shorthand,
 };
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list