[MPlayer-dev-eng] [PATCH] Volume for ao_macosx

Anders Johansson ajh at watri.org.au
Fri May 23 06:51:14 CEST 2003


> Hi,
> 
> Attached below is a patch which adds volume control to ao_macosx. I 
> took a peak at af_volume etc., to see if that could handle it, but it 
> seemed nearly impossible. So I extracted the required parts from 
> af_volume.c and simplified them.
> 
> There's one small thing that I don't understand me, namely soft 
> clipping:
> >if (x >=  M_PI/2)
> >  x = 1.0;
> >else if(x <= -M_PI/2)
> >  x = -1.0;
> >else
> >  x = sin(x);
> 
> What does the last line do?

It softclipps the signal if soft clipping is enabled. Using a sin()
reduces third overtone distorsion if the signal level is getting close
too 1.0 (or -1.0). You can safely remove the softclipping functions.

> 
> - Dan
> 

//Anders




More information about the MPlayer-dev-eng mailing list