You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
committed by
Michael Niedermayer
parent
50eee357eb
commit
efbc37a757
@@ -322,7 +322,7 @@ static int config_props(AVFilterLink *link)
|
|||||||
continue;
|
continue;
|
||||||
t = 0;
|
t = 0;
|
||||||
for (j = 0; j < link->channels; j++)
|
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) {
|
if (t > -1E-5 && t < 1E-5) {
|
||||||
// t is almost 0 but not exactly, this is probably a mistake
|
// t is almost 0 but not exactly, this is probably a mistake
|
||||||
if (t)
|
if (t)
|
||||||
|
Reference in New Issue
Block a user