[MPlayer-dev-eng] [PATCH] Bug fix in af_add/del/switch/clr

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 23 20:17:26 CET 2011


On Wed, Jan 19, 2011 at 02:29:03PM +0900, Jehan Pagès wrote:
> Though it seems unlikely to load filters every few milliseconds to
> notice this, the user who reported the bug used an audio equalizer
> filter reloading. I guess such an equalizer could be very often
> reloaded by a mplayer GUI while a user is trying to find the right
> values to apply to each frequency band (I guess this person was indeed
> developping some GUI to mplayer). And he wants to do this without
> music speeding or video desyncing. And anyway that's a bug, so it is
> good to fix. :-)

There's a command to change the audio filter parameters, so for the
equalizer case at least you don't have to do that.

> Basically to fix, I removed calls to reinit_audio_chain(); after such
> a dynamic load/unload of a filter. This was causing the issue and this
> was an unecessary call actually as any sound reinitialization was
> already dealed with in the functions which actually loaded/unloaded
> audio filters.

I would have to check again, but I think you are wrong: Only partial
reinitialization, namely only of filters after the modifed one is done.
IIRC this means that things like the "expansion ratio" might get wrong
- or maybe not, but this needs to be checks carefully since unfortunately
it is security-relevant.

> Attached is the small patch file.
> You can try the bug reproduction before and after, and confirms it has
> been fixed (I confirmed it on my machine and the user who reported me
> the bug also did for him).

Of course an interesting question is why does it fix it.
What is reinit_audio_chain doing that causes it?
Because probably reinit_audio_chain could and should be fixed,
from which other places that use it might benefit as well.


More information about the MPlayer-dev-eng mailing list