diff mbox series

[FFmpeg-devel,01/26] avfilter/af_afade: Remove redundant checks and assignments

Message ID AM7PR03MB6660B6828790199DE0D579748FA19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 9985ea765132fd0ff7c658637e033a165820e958
Headers show
Series [FFmpeg-devel,01/26] avfilter/af_afade: Remove redundant checks and assignments | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 21, 2021, 6:20 a.m. UTC
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.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/af_afade.c | 11 -----------
 1 file changed, 11 deletions(-)

Comments

Paul B Mahol Sept. 21, 2021, 6:52 a.m. UTC | #1
lgtm
Paul B Mahol Sept. 21, 2021, 7:05 a.m. UTC | #2
also rest of patch set lgtm, it is very trivial changes.
diff mbox series

Patch

diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index a55d5d72c3..3bd0331e77 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -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;