vf_fps: move initializing pts from config_props to init.
authorAnton Khirnov <anton@khirnov.net>
Mon, 18 Mar 2013 21:32:39 +0000 (22:32 +0100)
committerAnton Khirnov <anton@khirnov.net>
Fri, 17 May 2013 05:42:55 +0000 (07:42 +0200)
It should not be reinitialized if the link properties change.

libavfilter/vf_fps.c

index eb201fa898d06382260028de0c4355df8445dc39..7f5175248cfc3ec8a83fa925e427f5cb97ac8891 100644 (file)
@@ -77,6 +77,8 @@ static av_cold int init(AVFilterContext *ctx)
     if (!(s->fifo = av_fifo_alloc(2*sizeof(AVFrame*))))
         return AVERROR(ENOMEM);
 
+    s->pts          = AV_NOPTS_VALUE;
+
     av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, s->framerate.den);
     return 0;
 }
@@ -110,7 +112,6 @@ static int config_props(AVFilterLink* link)
     link->time_base = (AVRational){ s->framerate.den, s->framerate.num };
     link->w         = link->src->inputs[0]->w;
     link->h         = link->src->inputs[0]->h;
-    s->pts          = AV_NOPTS_VALUE;
 
     return 0;
 }