[FFmpeg-cvslog] lavfi/vf_fps: use standard options parsing.

Nicolas George git at videolan.org
Wed Mar 20 21:55:47 CET 2013


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sat Mar 16 21:27:34 2013 +0100| [b201c167d096a767adcac914b6e833d1db7d82ea] | committer: Nicolas George

lavfi/vf_fps: use standard options parsing.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b201c167d096a767adcac914b6e833d1db7d82ea
---

 libavfilter/vf_fps.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 3394252..5952538 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,
 };



More information about the ffmpeg-cvslog mailing list