avfilter/af_afade: Remove redundant checks and assignments

The acrossfade filter uses the ff_set_common_* functions in its
query_formats(), so that the formats, the sample rates as well as
the channel layouts and counts of all links coincide.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-21 02:40:56 +02:00
parent ed1a70469e
commit 9985ea7651

View File

@ -588,18 +588,7 @@ static int acrossfade_config_output(AVFilterLink *outlink)
AVFilterContext *ctx = outlink->src;
AudioFadeContext *s = ctx->priv;
if (ctx->inputs[0]->sample_rate != ctx->inputs[1]->sample_rate) {
av_log(ctx, AV_LOG_ERROR,
"Inputs must have the same sample rate "
"%d for in0 vs %d for in1\n",
ctx->inputs[0]->sample_rate, ctx->inputs[1]->sample_rate);
return AVERROR(EINVAL);
}
outlink->sample_rate = ctx->inputs[0]->sample_rate;
outlink->time_base = ctx->inputs[0]->time_base;
outlink->channel_layout = ctx->inputs[0]->channel_layout;
outlink->channels = ctx->inputs[0]->channels;
switch (outlink->format) {
case AV_SAMPLE_FMT_DBL: s->crossfade_samples = crossfade_samples_dbl; break;