[FFmpeg-devel] [PATCH 08/14] lavi/vf_drawbox: use standard options parsing.

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


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

diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index 41601b9..40fb8ac 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -68,14 +68,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     DrawBoxContext *drawbox = ctx->priv;
     uint8_t rgba_color[4];
-    static const char *shorthand[] = { "x", "y", "w", "h", "color", "thickness", NULL };
-    int ret;
-
-    drawbox->class = &drawbox_class;
-    av_opt_set_defaults(drawbox);
-
-    if ((ret = av_opt_set_from_string(drawbox, args, shorthand, "=", ":")) < 0)
-        return ret;
 
     if (!strcmp(drawbox->color_str, "invert"))
         drawbox->invert_color = 1;
@@ -185,6 +177,8 @@ static const AVFilterPad avfilter_vf_drawbox_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = { "x", "y", "w", "h", "color", "thickness", NULL };
+
 AVFilter avfilter_vf_drawbox = {
     .name      = "drawbox",
     .description = NULL_IF_CONFIG_SMALL("Draw a colored box on the input video."),
@@ -196,4 +190,5 @@ AVFilter avfilter_vf_drawbox = {
     .inputs    = avfilter_vf_drawbox_inputs,
     .outputs   = avfilter_vf_drawbox_outputs,
     .priv_class = &drawbox_class,
+    .shorthand = shorthand,
 };
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list