1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavfi/vf_fps: use standard options parsing.

This commit is contained in:
Nicolas George 2013-03-16 21:27:34 +01:00
parent 4e2bcec95f
commit b201c167d0

View File

@ -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,
};