Browse Source

lavfi/vf_fps: use standard options parsing.

tags/n2.0
Nicolas George 12 years ago
parent
commit
b201c167d0
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      libavfilter/vf_fps.c

+ 3
- 8
libavfilter/vf_fps.c 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,
};

Loading…
Cancel
Save