]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_mix.c
306
[xonotic/darkplaces.git] / snd_mix.c
index 1a8f65fdb92f3840ebe3e7e47819a2d42eb8ead8..efd562c21de80154a1082b183e2a6db1fe646155 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -279,8 +279,8 @@ void S_PaintChannels(int endtime)
                if (endtime - paintedtime > PAINTBUFFER_SIZE)
                        end = paintedtime + PAINTBUFFER_SIZE;
 
-               // clear the paint buffer, filling it with data from rawsamples (music/video/whatever)
-               S_RawSamples_Dequeue(&paintbuffer->left, end - paintedtime);
+               // clear the paint buffer
+               memset (&paintbuffer, 0, (end - paintedtime) * sizeof (paintbuffer[0]));
 
                // paint in the channels.
                ch = channels;
@@ -344,6 +344,11 @@ void S_PaintChannels(int endtime)
 
                                if (count > 0)
                                {
+                                       if (ch->leftvol > 255)
+                                               ch->leftvol = 255;
+                                       if (ch->rightvol > 255)
+                                               ch->rightvol = 255;
+
                                        if (sfx->format.width == 1)
                                                stop_paint = !SND_PaintChannelFrom8(ch, count);
                                        else
@@ -403,11 +408,6 @@ qboolean SND_PaintChannelFrom8 (channel_t *ch, int count)
        const sfxbuffer_t *sb;
        int i, n;
 
-       if (ch->leftvol > 255)
-               ch->leftvol = 255;
-       if (ch->rightvol > 255)
-               ch->rightvol = 255;
-
        lscale = snd_scaletable[ch->leftvol >> 3];
        rscale = snd_scaletable[ch->rightvol >> 3];