[MPlayer-users] Equalizer filter

Dmitry Ashkadov dmitry.ashkadov at rosalab.ru
Fri Mar 22 11:55:51 CET 2013


Hello!

I'm trying to use equalizer filter. It seems like it has a bug. Let me 
show you some test cases:

1. If I type in console

$ mplayer -af equalizer=0:0:0:0:0:0:0:0:0:0 some.mp3

then the sound volume is the same as if I type

$ mplayer some.mp3

2. If I pass to filter some negative value:

$ mplayer -af equalizer=0:-5:-5:-5:-5:-5:-5:-5:-5:0 some.mp3

then the sound volume will be quieter. It seems like equalizer is working.

3. But if I pass to filter positive value like:

$ mplayer -af equalizer=0:0:0:0:1:0:0:0:0:0 some.mp3

then the sound volume will be quiter than sound volume with disabled filter.


I've found several interesting lines at libaf/af_equalizer.c

> for(k=0;k<AF_NCH;k++)
>     {
>         for(i=0;i<KM;i++)
>         {
>             if(s->gain_factor < s->g[k][i]) s->gain_factor=s->g[k][i];
>         }
>     }
>
>     s->gain_factor=log10(s->gain_factor + 1.0) * 20.0;
>
>     if(s->gain_factor > 0.0)
>     {
>         s->gain_factor=0.1+(s->gain_factor/12.0);
>     }else{
>         s->gain_factor=1;
>     }

if one of numbers is positive like equalizer=0:0:0:0:1:0:0:0:0:0 then 
s->gain_factor will be maximum of s->g[k][i], and then s->gain_factor 
will be more that 0. So, s->gain_factor will be set to 0.1 plus a little 
value (will be < 1). So, this will make sound quiter (:

I don't know for what reason common gain_factor is user. What do you 
think about this problem?

Thank you!





More information about the MPlayer-users mailing list