From a334e97bd7b1e7b37fe40a96caf9ccb8504c3f96 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 2 Mar 2008 13:45:58 +0000 Subject: [PATCH] added support for snd_blocked (related to the snd_mutewhenidle cvar) in threaded mixers git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8178 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_coreaudio.c | 2 ++ snd_sdl.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/snd_coreaudio.c b/snd_coreaudio.c index 48d7a5b9..cb653f04 100644 --- a/snd_coreaudio.c +++ b/snd_coreaudio.c @@ -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()) diff --git a/snd_sdl.c b/snd_sdl.c index 4bcc0e7c..dae644de 100644 --- 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; } -- 2.39.2