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.
Unified · Split
| @@ -588,18 +588,7 @@ static int acrossfade_config_output(AVFilterLink *outlink) · 587 unmodified lines | |||
| 588 | AVFilterContext *ctx = outlink->src; | 588 | AVFilterContext *ctx = outlink->src; |
| 589 | AudioFadeContext *s = ctx->priv; | 589 | AudioFadeContext *s = ctx->priv; |
| 590 | 590 | ||
| 591 | if (ctx->inputs[0]->sample_rate != ctx->inputs[1]->sample_rate) { | ||
| 592 | av_log(ctx, AV_LOG_ERROR, | ||
| 593 | "Inputs must have the same sample rate " | ||
| 594 | "%d for in0 vs %d for in1\n", | ||
| 595 | ctx->inputs[0]->sample_rate, ctx->inputs[1]->sample_rate); | ||
| 596 | return AVERROR(EINVAL); | ||
| 597 | } | ||
| 598 | |||
| 599 | outlink->sample_rate = ctx->inputs[0]->sample_rate; | ||
| 600 | outlink->time_base = ctx->inputs[0]->time_base; | 591 | outlink->time_base = ctx->inputs[0]->time_base; |
| 601 | outlink->channel_layout = ctx->inputs[0]->channel_layout; | ||
| 602 | outlink->channels = ctx->inputs[0]->channels; | ||
| 603 | 592 | ||
| 604 | switch (outlink->format) { | 593 | switch (outlink->format) { |
| 605 | case AV_SAMPLE_FMT_DBL: s->crossfade_samples = crossfade_samples_dbl; break; | 594 | case AV_SAMPLE_FMT_DBL: s->crossfade_samples = crossfade_samples_dbl; break; |