]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix decay calculation in snd_softclip
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 14 Oct 2011 18:53:03 +0000 (18:53 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 14 Oct 2011 18:52:41 +0000 (20:52 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11416 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=2b6658ae80858652e17ad3489e4bf5df6a7b8106

snd_mix.c

index 3495d86d2fca33b6e3dcd59ae226e9946c688af5..50c07bcc8b1fe9e8ea704d0c368e7e3124a17dec 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;