[FFmpeg-devel] [PATCH] avfilter/af_pan: parse properly expressions referencing the same channel multiple times

Marton Balint cus at passwd.hu
Sun Mar 25 00:00:32 EET 2018


Fixes parsing of expressions like c0=c0+c0. Previously no error was thrown and
only the last gain factor was used.

Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavfilter/af_pan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index d8a63a7952..148ac9f643 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -184,7 +184,7 @@ static av_cold int init(AVFilterContext *ctx)
                 ret = AVERROR(EINVAL);
                 goto fail;
             }
-            pan->gain[out_ch_id][in_ch_id] = sign * gain;
+            pan->gain[out_ch_id][in_ch_id] += sign * gain;
             skip_spaces(&arg);
             if (!*arg)
                 break;
-- 
2.13.6



More information about the ffmpeg-devel mailing list