aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-05-20 14:41:14 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-05-20 18:24:20 +0200
commit4a5d18b6e264779c4d3629f6b724c5ca44c41b03 (patch)
tree9a239943194d98941cfde96135864b239a02a796
parentdc6a02de01d5aeb18a557fe81ed02ec98b105049 (diff)
downloadffmpeg-4a5d18b6e264779c4d3629f6b724c5ca44c41b03.tar.gz
vsrc_mandelbrot: use AV_OPT_TYPE_IMAGE_SIZE.
-rw-r--r--libavfilter/vsrc_mandelbrot.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c
index 27f6671f76..9d442007e3 100644
--- a/libavfilter/vsrc_mandelbrot.c
+++ b/libavfilter/vsrc_mandelbrot.c
@@ -57,7 +57,7 @@ typedef struct {
int w, h;
AVRational time_base;
uint64_t pts;
- char *size, *rate;
+ char *rate;
int maxiter;
double start_x;
double start_y;
@@ -78,8 +78,8 @@ typedef struct {
#define OFFSET(x) offsetof(MBContext, x)
static const AVOption mandelbrot_options[] = {
- {"size", "set frame size", OFFSET(size), AV_OPT_TYPE_STRING, {.str="640x480"}, CHAR_MIN, CHAR_MAX },
- {"s", "set frame size", OFFSET(size), AV_OPT_TYPE_STRING, {.str="640x480"}, CHAR_MIN, CHAR_MAX },
+ {"size", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, CHAR_MIN, CHAR_MAX },
+ {"s", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, CHAR_MIN, CHAR_MAX },
{"rate", "set frame rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str="25"}, CHAR_MIN, CHAR_MAX },
{"r", "set frame rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str="25"}, CHAR_MIN, CHAR_MAX },
{"maxiter", "set max iterations number", OFFSET(maxiter), AV_OPT_TYPE_INT, {.dbl=7189}, 1, INT_MAX },
@@ -129,10 +129,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
}
mb->bailout *= mb->bailout;
- if (av_parse_video_size(&mb->w, &mb->h, mb->size) < 0) {
- av_log(ctx, AV_LOG_ERROR, "Invalid frame size: %s\n", mb->size);
- return AVERROR(EINVAL);
- }
mb->start_scale /=mb->h;
mb->end_scale /=mb->h;
@@ -157,7 +153,6 @@ static av_cold void uninit(AVFilterContext *ctx)
{
MBContext *mb = ctx->priv;
- av_freep(&mb->size);
av_freep(&mb->rate);
av_freep(&mb->point_cache);
av_freep(&mb-> next_cache);