fix decay calculation in snd_softclip
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 14 Oct 2011 18:53:03 +0000 (18:53 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 14 Oct 2011 18:53:03 +0000 (18:53 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11416 d7cf8633-e32d-0410-b094-e92efae38249

snd_mix.c

index 3495d86..50c07bc 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -64,7 +64,7 @@ static void S_SoftClipPaintBuffer(portable_sampleframe_t *painted_ptr, int nbfra
 
                // let's do a simple limiter instead, seems to sound better
                static float maxvol = 0;
-               maxvol = max(1.0f, maxvol * (1.0f - nbframes / snd_renderbuffer->format.speed));
+               maxvol = max(1.0f, maxvol * (1.0f - nbframes / (0.4f * snd_renderbuffer->format.speed)));
 #define SOFTCLIP(x) if((x)>maxvol) maxvol=(x); (x) /= maxvol;
 
                portable_sampleframe_t *p = painted_ptr;