]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_sdl.c
make DP compile with C++ again
[xonotic/darkplaces.git] / snd_sdl.c
index 4bcc0e7c392ea312ba6daa5db6e5d0a7694a95ac..667d56b37fcb58c072c38ea17b082336743b43ba 100644 (file)
--- a/snd_sdl.c
+++ b/snd_sdl.c
@@ -42,6 +42,8 @@ static void Buffer_Callback (void *userdata, Uint8 *stream, int len)
        if (snd_usethreadedmixing)
        {
                S_MixToBuffer(stream, RequestedFrames);
+               if (snd_blocked)
+                       memset(stream, snd_renderbuffer->format.width == 1 ? 0x80 : 0, len);
                return;
        }
 
@@ -99,7 +101,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
                return false;
        }
 
-       buffersize = (unsigned int)ceil((double)requested->speed / 20.0);
+       buffersize = (unsigned int)ceil((double)requested->speed / 25.0); // 2048 bytes on 24kHz to 48kHz
 
        // Init the SDL Audio subsystem
        wantspec.callback = Buffer_Callback;