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

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


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

diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index a74e6d8..d1c4f6c 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -78,14 +78,6 @@ AVFILTER_DEFINE_CLASS(fade);
 static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     FadeContext *fade = ctx->priv;
-    static const char *shorthand[] = { "type", "start_frame", "nb_frames", NULL };
-    int ret;
-
-    fade->class = &fade_class;
-    av_opt_set_defaults(fade);
-
-    if ((ret = av_opt_set_from_string(fade, args, shorthand, "=", ":")) < 0)
-        return ret;
 
     fade->fade_per_frame = (1 << 16) / fade->nb_frames;
     if (!strcmp(fade->type, "in"))
@@ -247,6 +239,8 @@ static const AVFilterPad avfilter_vf_fade_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = { "type", "start_frame", "nb_frames", NULL };
+
 AVFilter avfilter_vf_fade = {
     .name          = "fade",
     .description   = NULL_IF_CONFIG_SMALL("Fade in/out input video."),
@@ -258,4 +252,5 @@ AVFilter avfilter_vf_fade = {
     .inputs    = avfilter_vf_fade_inputs,
     .outputs   = avfilter_vf_fade_outputs,
     .priv_class = &fade_class,
+    .shorthand = shorthand,
 };
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list