diff mbox

[FFmpeg-devel,v2,3/3] libavfilter/vf_fps: Minor cleanups

Message ID 029f1c953f81818a0bcc554fa1b517db7bd4ac2f.1519088056.git.calvin.walton@kepstin.ca
State Accepted
Commit 2b2c8b22da9f9f0005b619a539023afbad1a1edd
Headers show

Commit Message

Calvin Walton Feb. 20, 2018, 12:54 a.m. UTC
Since the config_props function now references both the input and output
links, rename the 'link' variable to 'outlink'.

Fix up some mismatching indentation.

Don't bother setting the width and height on the outlink; the filter
framework does that for us.
---
 libavfilter/vf_fps.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

Comments

Nicolas George Feb. 22, 2018, 11:21 a.m. UTC | #1
Calvin Walton (2018-02-19):
> Since the config_props function now references both the input and output
> links, rename the 'link' variable to 'outlink'.
> 
> Fix up some mismatching indentation.
> 
> Don't bother setting the width and height on the outlink; the filter
> framework does that for us.
> ---
>  libavfilter/vf_fps.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)

LGTM; will apply after the 1st patch is finalized unless somebody
objects. Thanks.

Regards,
diff mbox

Patch

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 74500f59c9..0ca4f8563f 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -137,16 +137,14 @@  static av_cold void uninit(AVFilterContext *ctx)
            "%d frames duplicated.\n", s->frames_in, s->frames_out, s->drop, s->dup);
 }
 
-static int config_props(AVFilterLink* link)
+static int config_props(AVFilterLink* outlink)
 {
-    AVFilterContext *ctx = link->src;
-    AVFilterLink *inlink = ctx->inputs[0];
-    FPSContext   *s = ctx->priv;
+    AVFilterContext *ctx    = outlink->src;
+    AVFilterLink    *inlink = ctx->inputs[0];
+    FPSContext      *s      = ctx->priv;
 
-    link->time_base = av_inv_q(s->framerate);
-    link->frame_rate= s->framerate;
-    link->w         = link->src->inputs[0]->w;
-    link->h         = link->src->inputs[0]->h;
+    outlink->time_base  = av_inv_q(s->framerate);
+    outlink->frame_rate = s->framerate;
 
     /* Calculate the input and output pts offsets for start_time */
     if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) {
@@ -158,7 +156,7 @@  static int config_props(AVFilterLink* link)
         }
         s->in_pts_off  = av_rescale_q_rnd(first_pts, AV_TIME_BASE_Q, inlink->time_base,
                                           s->rounding | AV_ROUND_PASS_MINMAX);
-        s->out_pts_off = av_rescale_q_rnd(first_pts, AV_TIME_BASE_Q, link->time_base,
+        s->out_pts_off = av_rescale_q_rnd(first_pts, AV_TIME_BASE_Q, outlink->time_base,
                                           s->rounding | AV_ROUND_PASS_MINMAX);
         s->next_pts = s->out_pts_off;
         av_log(ctx, AV_LOG_VERBOSE, "Set first pts to (in:%"PRId64" out:%"PRId64") from start time %f\n",