diff options
author | Moritz Barsnick <[email protected]> | 2016-10-09 03:49:15 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2016-10-11 03:27:59 +0200 |
commit | efbc37a757d6b41af1a5752ff810db1dcf3fe78c (patch) | |
tree | 237ac40db33cf260da63a1b63999c699db52dcb5 | |
parent | 50eee357eb171e62a87da7a5c95a1c76685df291 (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 <[email protected]>
Reviewed-by: Nicolas George <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavfilter/af_pan.c | 2 |
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) |