[FFmpeg-cvslog] avfilter/af_adelay: use outlink where applicable
Paul B Mahol
git at videolan.org
Sun Nov 7 21:47:59 EET 2021
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Nov 7 19:00:50 2021 +0100| [0370c3e3d4dda36a18fe640bd318b937ee98874d] | committer: Paul B Mahol
avfilter/af_adelay: use outlink where applicable
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0370c3e3d4dda36a18fe640bd318b937ee98874d
---
libavfilter/af_adelay.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c
index c42fa2d175..ed8a8ae739 100644
--- a/libavfilter/af_adelay.c
+++ b/libavfilter/af_adelay.c
@@ -189,14 +189,15 @@ static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
AudioDelayContext *s = ctx->priv;
AVFrame *out_frame;
int i;
if (ctx->is_disabled || !s->delays)
- return ff_filter_frame(ctx->outputs[0], frame);
+ return ff_filter_frame(outlink, frame);
- out_frame = ff_get_audio_buffer(ctx->outputs[0], frame->nb_samples);
+ out_frame = ff_get_audio_buffer(outlink, frame->nb_samples);
if (!out_frame) {
av_frame_free(&frame);
return AVERROR(ENOMEM);
@@ -215,9 +216,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
out_frame->pts = s->next_pts;
- s->next_pts += av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base);
+ s->next_pts += av_rescale_q(frame->nb_samples, (AVRational){1, outlink->sample_rate}, outlink->time_base);
av_frame_free(&frame);
- return ff_filter_frame(ctx->outputs[0], out_frame);
+ return ff_filter_frame(outlink, out_frame);
}
static int activate(AVFilterContext *ctx)
More information about the ffmpeg-cvslog
mailing list