diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-11-07 19:00:50 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-11-07 20:47:21 +0100 |
commit | 0370c3e3d4dda36a18fe640bd318b937ee98874d (patch) | |
tree | ac849e5a95feef0eaa87547a6cc02a5b5258f0df | |
parent | cd03a180cb66ca199707ad129a4ab44548711c94 (diff) | |
download | ffmpeg-0370c3e3d4dda36a18fe640bd318b937ee98874d.tar.gz |
avfilter/af_adelay: use outlink where applicable
-rw-r--r-- | libavfilter/af_adelay.c | 9 |
1 files 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) |