diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2013-03-16 21:27:34 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2013-03-20 21:13:56 +0100 |
commit | b201c167d096a767adcac914b6e833d1db7d82ea (patch) | |
tree | 5b68c920da042986d232ed4e0f3e55a9f49487e2 | |
parent | 4e2bcec95f81352be229ffd87c373acc2c992d9d (diff) | |
download | ffmpeg-b201c167d096a767adcac914b6e833d1db7d82ea.tar.gz |
lavfi/vf_fps: use standard options parsing.
-rw-r--r-- | libavfilter/vf_fps.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c index 3394252687..5952538133 100644 --- a/libavfilter/vf_fps.c +++ b/libavfilter/vf_fps.c @@ -74,20 +74,12 @@ AVFILTER_DEFINE_CLASS(fps); static av_cold int init(AVFilterContext *ctx, const char *args) { FPSContext *s = ctx->priv; - const char *shorthand[] = { "fps", "round", NULL }; int ret; - s->class = &fps_class; - av_opt_set_defaults(s); - - if ((ret = av_opt_set_from_string(s, args, shorthand, "=", ":")) < 0) - return ret; - if ((ret = av_parse_video_rate(&s->framerate, s->fps)) < 0) { av_log(ctx, AV_LOG_ERROR, "Error parsing framerate %s.\n", s->fps); return ret; } - av_opt_free(s); if (!(s->fifo = av_fifo_alloc(2*sizeof(AVFrame*)))) return AVERROR(ENOMEM); @@ -288,6 +280,8 @@ static const AVFilterPad avfilter_vf_fps_outputs[] = { { NULL } }; +static const char *const shorthand[] = { "fps", "round", NULL }; + AVFilter avfilter_vf_fps = { .name = "fps", .description = NULL_IF_CONFIG_SMALL("Force constant framerate"), @@ -300,4 +294,5 @@ AVFilter avfilter_vf_fps = { .inputs = avfilter_vf_fps_inputs, .outputs = avfilter_vf_fps_outputs, .priv_class = &fps_class, + .shorthand = shorthand, }; |