From 79752d8b393b5d7935c97919cf0963d5c760d5f1 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 14 Oct 2011 18:59:55 +0000 Subject: [PATCH] add missing fabs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11417 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_mix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snd_mix.c b/snd_mix.c index 50c07bcc..fa0069aa 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -65,7 +65,7 @@ static void S_SoftClipPaintBuffer(portable_sampleframe_t *painted_ptr, int nbfra // let's do a simple limiter instead, seems to sound better static float maxvol = 0; maxvol = max(1.0f, maxvol * (1.0f - nbframes / (0.4f * snd_renderbuffer->format.speed))); -#define SOFTCLIP(x) if((x)>maxvol) maxvol=(x); (x) /= maxvol; +#define SOFTCLIP(x) if(fabs(x)>maxvol) maxvol=fabs(x); (x) /= maxvol; portable_sampleframe_t *p = painted_ptr; if (channels == 8) // 7.1 surround -- 2.39.2