[MPlayer-dev-eng] [PATCH] af_pan: hard clipping, and more than 100% of source channels

Corey Hickey bugfood-ml at fatooh.org
Thu Sep 15 04:58:04 CEST 2005


Reimar Döffinger wrote:
>>+Be careful when using values higher than 1; higher values can be quite
>>+loud and may exceed the sample range of your sound card.
> 
> 
> Actually this kind of things can happen when the absolute sum of all
> values for this output channel is > 1. Just in case you find a good way
> to express this without getting mathmatical.

Yeah. I was too lazy to say so before, but I really ought to have.

> 
>>-      s->level[k][j] = clamp(s->level[k][j],0.0,1.0);
>>+      s->level[k][j] = clamp(s->level[k][j],0.0,MAX_LVL);
> 
> 
>>-      s->level[ch][i] = clamp(level[i],0.0,1.0);
>>+      s->level[ch][i] = clamp(level[i],0.0,MAX_LVL);
> 
> 
> I vote for replacing 0.0 with -MAX_LVL, too.
> Though explaining this in the man page might be a bit more difficult.

It's kind of fun, so I've updated the patch with that change. Can anyone
come up with good/amusing uses for it besides the two I've added to the
docs?

-Corey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: af_pan-and-docs.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050914/79290850/attachment.txt>


More information about the MPlayer-dev-eng mailing list