diff mbox series

[FFmpeg-devel,06/26] avfilter/af_sidechaincompress: Remove always-false samplerate check

Message ID AM7PR03MB6660A4A6CA9128E8C97FDA698FA19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 910215b4db2bb42a2bdca53a4f7bf455f764aa9b
Headers show
Series [FFmpeg-devel,01/26] avfilter/af_afade: Remove redundant checks and assignments
Related show

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:27 a.m. UTC
This filter uses ff_set_common_all_samplerates().
Also don't overwrite outlink->sample_rate in config_output;
it is harmless, because it is overwritten with the value it already
had, but it is an API violation.

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

Comments

Paul B Mahol Sept. 21, 2021, 7:01 a.m. UTC | #1
lgtm
diff mbox series

Patch

diff --git a/libavfilter/af_sidechaincompress.c b/libavfilter/af_sidechaincompress.c
index af4a90ea09..22a86ae2a7 100644
--- a/libavfilter/af_sidechaincompress.c
+++ b/libavfilter/af_sidechaincompress.c
@@ -323,15 +323,6 @@  static int config_output(AVFilterLink *outlink)
     AVFilterContext *ctx = outlink->src;
     SidechainCompressContext *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;
 
     s->fifo[0] = av_audio_fifo_alloc(ctx->inputs[0]->format, ctx->inputs[0]->channels, 1024);