[MPlayer-dev-eng] [PATCH] forceable software volume control

Ed Wildgoose lists at wildgooses.com
Tue Nov 16 09:03:01 CET 2004


>the proper solution of course would be a soft-clipping volume filter.
>but af_volume sucks too much to do this except with float mode, which
>is totally broken.
>  
>

I only scanned the code quickly, but can you fill me in quickly as to 
what the problem is here?  Going "float" would of course be extremely 
desirable if we are only in 16bit mode to start with, but I assume that 
it needs to do a truncation somewhere rather than pass the output to the 
output driver as floats?

I had considered the idea of a plugin to "guess" the max range of the 
DVD and set the volume control appropriately.  I think a very simplistic 
approach would be sufficient actually: Take a starting gain from the 
user.  Whenever we would clip then reduce the volume control to avoid 
clipping.  Done.  The idea would be that the (nearly) loudest part of 
all DVDs is the first scene, so the volume should get backed down pretty 
quickly.  Then only if we get some massive transient in the film do we 
back down the volume a little more, hopefully not enough that the 
listeners even notice.  Based on looking through just a couple of DVD's 
this would seem to be quite a usable strategy to "normalise" the volume 
levels on perhaps the majority of the stuff I own.

In my case I have an external volume control, but like you I have the 
problem that music is very loud and then switching to mplayer for films 
is very quiet.

Ed W




More information about the MPlayer-dev-eng mailing list