diff mbox series

[FFmpeg-devel,05/26] avfilter/af_amerge: Remove always-false samplerate check

Message ID AM7PR03MB6660C543BF677C68EEBD25228FA19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit e1487deb19d218b7f954d675e2603d26b9e0d97e
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: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_amerge.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

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

Patch

diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index d67e3d7e32..9c6da15a9f 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -151,17 +151,7 @@  static int config_output(AVFilterLink *outlink)
     AVBPrint bp;
     int i;
 
-    for (i = 1; i < s->nb_inputs; i++) {
-        if (ctx->inputs[i]->sample_rate != ctx->inputs[0]->sample_rate) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Inputs must have the same sample rate "
-                   "%d for in%d vs %d\n",
-                   ctx->inputs[i]->sample_rate, i, ctx->inputs[0]->sample_rate);
-            return AVERROR(EINVAL);
-        }
-    }
     s->bps = av_get_bytes_per_sample(ctx->outputs[0]->format);
-    outlink->sample_rate = ctx->inputs[0]->sample_rate;
     outlink->time_base   = ctx->inputs[0]->time_base;
 
     av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);