]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
sound mixing: PROPERLY detect silent sounds. Old code would cut off sounds at -15dB...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 Oct 2011 17:57:23 +0000 (17:57 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 8 Oct 2011 18:38:30 +0000 (20:38 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11393 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=12849b354eaba65efdaad7277863f6b0f036bb38

snd_mix.c

index 67898912149e19dcd3d0cd48314245569a7da96c..eab51a6474002d58d98266edb9609ead2907a4fb 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -249,7 +249,7 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes)
                        sum = 0;
                        for (i = 0;i < SND_LISTENERS;i++)
                                sum += vol[i]*vol[i];
-                       silent = sum < 0.001f;
+                       silent = sum < (1.0f / (65536.0f * 65536.0f)); // so silent it has zero effect
 
                        // when doing prologic mixing, some channels invert one side
                        if (ch->prologic_invert == -1)