diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-08-06 08:50:21 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-08-15 19:34:27 +0200 |
commit | a23d565ea7d41e61f160578f9714a23e695f3bfd (patch) | |
tree | 4f49446e8da10c5496cffbd1e0e3270b61ca7381 /libavfilter/avf_showwaves.c | |
parent | d6318a244d1dde48c1429c48b4076df47c2c7fe9 (diff) | |
download | ffmpeg-a23d565ea7d41e61f160578f9714a23e695f3bfd.tar.gz |
lavfi: move AVFilterLink.frame_rate to FilterLink
Co-developed-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/avf_showwaves.c')
-rw-r--r-- | libavfilter/avf_showwaves.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c index 63e0b36e09..823f1c6fd3 100644 --- a/libavfilter/avf_showwaves.c +++ b/libavfilter/avf_showwaves.c @@ -409,6 +409,7 @@ static void draw_sample_cline_gray(uint8_t *buf, int height, int linesize, static int config_output(AVFilterLink *outlink) { + FilterLink *l = ff_filter_link(outlink); AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = ctx->inputs[0]; ShowWavesContext *showwaves = ctx->priv; @@ -422,14 +423,14 @@ static int config_output(AVFilterLink *outlink) if (showwaves->single_pic) { showwaves->n = av_make_q(1, 1); - outlink->frame_rate = av_make_q(1, 1); + l->frame_rate = av_make_q(1, 1); } else { if (!showwaves->n.num || !showwaves->n.den) { showwaves->n = av_mul_q(av_make_q(inlink->sample_rate, showwaves->w), av_inv_q(showwaves->rate)); - outlink->frame_rate = showwaves->rate; + l->frame_rate = showwaves->rate; } else { - outlink->frame_rate = av_div_q(av_make_q(inlink->sample_rate, showwaves->w), showwaves->n); + l->frame_rate = av_div_q(av_make_q(inlink->sample_rate, showwaves->w), showwaves->n); } } @@ -448,13 +449,13 @@ static int config_output(AVFilterLink *outlink) if (!showwaves->history) return AVERROR(ENOMEM); - outlink->time_base = av_inv_q(outlink->frame_rate); + outlink->time_base = av_inv_q(l->frame_rate); outlink->w = showwaves->w; outlink->h = showwaves->h; outlink->sample_aspect_ratio = (AVRational){1,1}; av_log(ctx, AV_LOG_VERBOSE, "s:%dx%d r:%f n:%f\n", - showwaves->w, showwaves->h, av_q2d(outlink->frame_rate), av_q2d(showwaves->n)); + showwaves->w, showwaves->h, av_q2d(l->frame_rate), av_q2d(showwaves->n)); switch (outlink->format) { case AV_PIX_FMT_GRAY8: |