From dc1050a3e8557fc423023036f698cc476fb675b4 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 16 Sep 2015 09:27:30 +0000 Subject: [PATCH] avfilter/af_ladspa: process all channels for nb_handles > 1 Signed-off-by: Paul B Mahol --- libavfilter/af_ladspa.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavfilter/af_ladspa.c b/libavfilter/af_ladspa.c index 655c01811d..890888096c 100644 --- a/libavfilter/af_ladspa.c +++ b/libavfilter/af_ladspa.c @@ -142,7 +142,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFilterContext *ctx = inlink->dst; LADSPAContext *s = ctx->priv; AVFrame *out; - int i, h; + int i, h, p; if (!s->nb_outputs || (av_frame_is_writable(in) && s->nb_inputs == s->nb_outputs && @@ -159,13 +159,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) for (h = 0; h < s->nb_handles; h++) { for (i = 0; i < s->nb_inputs; i++) { + p = s->nb_handles > 1 ? h : i; s->desc->connect_port(s->handles[h], s->ipmap[i], - (LADSPA_Data*)in->extended_data[i]); + (LADSPA_Data*)in->extended_data[p]); } for (i = 0; i < s->nb_outputs; i++) { + p = s->nb_handles > 1 ? h : i; s->desc->connect_port(s->handles[h], s->opmap[i], - (LADSPA_Data*)out->extended_data[i]); + (LADSPA_Data*)out->extended_data[p]); } s->desc->run(s->handles[h], in->nb_samples);