summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Barsnick <barsnick@gmx.net>2016-10-09 03:49:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-10-11 03:27:59 +0200
commitefbc37a757d6b41af1a5752ff810db1dcf3fe78c (patch)
tree237ac40db33cf260da63a1b63999c699db52dcb5
parent50eee357eb171e62a87da7a5c95a1c76685df291 (diff)
lavfi/pan: renormalize negative gain coefficients properly
The parser for the outdef will accept a negative value for the first named channel's gain. As negative values effectively only invert the phase of the signal, and not negate the level, the gains' absolute values must be used to correctly accumulate the levels. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/af_pan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index 7c02f6720d..fbd79a5a42 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -322,7 +322,7 @@ static int config_props(AVFilterLink *link)
continue;
t = 0;
for (j = 0; j < link->channels; j++)
- t += pan->gain[i][j];
+ t += fabs(pan->gain[i][j]);
if (t > -1E-5 && t < 1E-5) {
// t is almost 0 but not exactly, this is probably a mistake
if (t)