]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added support for snd_blocked (related to the snd_mutewhenidle cvar) in
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 Mar 2008 13:45:58 +0000 (13:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 Mar 2008 13:45:58 +0000 (13:45 +0000)
threaded mixers

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8178 d7cf8633-e32d-0410-b094-e92efae38249

snd_coreaudio.c
snd_sdl.c

index 48d7a5b9cade8ded9bee04ab4eed78433cfbc043..cb653f0447090953bc792784d52f8db44c9b748c 100644 (file)
@@ -60,6 +60,8 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice,
        outBuffer = (float*)outOutputData->mBuffers[0].mData;
        factor = snd_renderbuffer->format.channels * snd_renderbuffer->format.width;
        frameCount = 0;
+       if (snd_blocked)
+               scale = 0;
 
        // Lock the snd_renderbuffer
        if (SndSys_LockRenderBuffer())
index 4bcc0e7c392ea312ba6daa5db6e5d0a7694a95ac..dae644de4c4220e3ab609cc732ce265c0847a0ca 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;
        }