]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vsrc_life.c
lavfi: fix erroneous use of AV_PERM_PRESERVE in ff_inplace_start_frame.
[ffmpeg] / libavfilter / vsrc_life.c
index 5b4dc995763377bd457bb074e735853421a55a85..b2b7c4a87dcca63e43bfb3d582dabdaa6e8dd107 100644 (file)
@@ -32,6 +32,7 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/random_seed.h"
 #include "avfilter.h"
+#include "internal.h"
 #include "formats.h"
 #include "video.h"
 
@@ -97,13 +98,7 @@ static const AVOption life_options[] = {
     { NULL },
 };
 
-static const AVClass life_class = {
-    .class_name = "life",
-    .item_name  = av_default_item_name,
-    .option     = life_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-    .category   = AV_CLASS_CATEGORY_FILTER,
-};
+AVFILTER_DEFINE_CLASS(life);
 
 static int parse_rule(uint16_t *born_rule, uint16_t *stay_rule,
                       const char *rule_str, void *log_ctx)
@@ -224,7 +219,7 @@ static int init_pattern_from_file(AVFilterContext *ctx)
     return 0;
 }
 
-static int init(AVFilterContext *ctx, const char *args, void *opaque)
+static int init(AVFilterContext *ctx, const char *args)
 {
     LifeContext *life = ctx->priv;
     AVRational frame_rate;
@@ -233,10 +228,8 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque)
     life->class = &life_class;
     av_opt_set_defaults(life);
 
-    if ((ret = av_set_options_string(life, args, "=", ":")) < 0) {
-        av_log(ctx, AV_LOG_ERROR, "Error parsing options string: '%s'\n", args);
+    if ((ret = av_set_options_string(life, args, "=", ":")) < 0)
         return ret;
-    }
 
     if ((ret = av_parse_video_rate(&frame_rate, life->rate)) < 0) {
         av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: %s\n", life->rate);
@@ -296,7 +289,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque)
             return ret;
     }
 
-    av_log(ctx, AV_LOG_INFO,
+    av_log(ctx, AV_LOG_VERBOSE,
            "s:%dx%d r:%d/%d rule:%s stay_rule:%d born_rule:%d stitch:%d seed:%u\n",
            life->w, life->h, frame_rate.num, frame_rate.den,
            life->rule_str, life->stay_rule, life->born_rule, life->stitch,