]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix two warnings (both were bad but unlikely to cause issues)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 26 Sep 2011 16:00:20 +0000 (16:00 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 26 Sep 2011 16:00:20 +0000 (16:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11370 d7cf8633-e32d-0410-b094-e92efae38249

snd_mix.c

index e976bca79e95289f9a4097616255a743209330b4..67898912149e19dcd3d0cd48314245569a7da96c 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -246,6 +246,7 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes)
                                vol[i] = ch->volume[i];
 
                        // check total volume level, because we can skip some code on silent sounds but other code must still run (position updates mainly)
+                       sum = 0;
                        for (i = 0;i < SND_LISTENERS;i++)
                                sum += vol[i]*vol[i];
                        silent = sum < 0.001f;
@@ -262,6 +263,7 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes)
                        // do the actual paint now (may skip work if silent)
                        paint = paintbuffer;
                        wantframes = totalmixframes;
+                       istartframe = 0;
                        for (wantframes = totalmixframes;wantframes > 0;posd += count * speedd, wantframes -= count)
                        {
                                // check if this is a delayed sound