Commit b201c167 authored by Nicolas George's avatar Nicolas George

lavfi/vf_fps: use standard options parsing.

parent 4e2bcec9
......@@ -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,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment