From: havoc Date: Sun, 2 Mar 2008 13:45:58 +0000 (+0000) Subject: added support for snd_blocked (related to the snd_mutewhenidle cvar) in X-Git-Tag: xonotic-v0.1.0preview~2346 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=a334e97bd7b1e7b37fe40a96caf9ccb8504c3f96 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 --- 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; }