[FFmpeg-devel] [PATCH] fix bug in af_pan channel coefficient parser

Nicolas George george at nsup.org
Sun Nov 19 18:39:38 EET 2017

L'octidi 28 brumaire, an CCXXVI, Michael Roitzsch a écrit :
> Hi FFmpeg team,
> I was using af_pan to subtract one audio file from another. I first used an amerge filter and then configured the pan filter with a channel formula like c0=c0-c2|c1=c1-c3.
> However, this does not work as expected. In debug output, I can see that channel 0 correctly uses gain coefficients 1 and -1 for c0 and c2. But channel 1 incorrectly uses -1 and -1 for c1 and c3.
> I looked into the code and found that the sign handling is currently wrong. When the last contribution of a formula is subtracted, the sign variable will be correctly set to -1 in line 191. But when then leaving the gains loop in line 189, because we reached the end of the formula for an output channel, sign is not reset. We therefore re-enter the gains loop for the next output channel with sign still -1. The first gain in this new formula will therefore be negated.
> The attached patch fixes the problem for me.

Thanks, applied.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171119/8894cb98/attachment.sig>

More information about the ffmpeg-devel mailing list