From e7c4681e9a57c60b6432b515681df6c0d153d1da Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 21 Aug 2017 00:27:52 -0700 Subject: [PATCH] 0 meters per unit is invalid --- Alc/ALc.c | 4 ++-- OpenAL32/alListener.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Alc/ALc.c b/Alc/ALc.c index a1c17087..7fcac99d 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -2515,7 +2515,7 @@ static ALvoid InitContext(ALCcontext *Context) //Initialise listener listener->Gain = 1.0f; - listener->MetersPerUnit = 1.0f; + listener->MetersPerUnit = AL_DEFAULT_METERS_PER_UNIT; listener->Position[0] = 0.0f; listener->Position[1] = 0.0f; listener->Position[2] = 0.0f; @@ -2537,7 +2537,7 @@ static ALvoid InitContext(ALCcontext *Context) ); aluVectorSet(&listener->Params.Velocity, 0.0f, 0.0f, 0.0f, 0.0f); listener->Params.Gain = 1.0f; - listener->Params.MetersPerUnit = 1.0f; + listener->Params.MetersPerUnit = listener->MetersPerUnit; listener->Params.DopplerFactor = 1.0f; listener->Params.SpeedOfSound = SPEEDOFSOUNDMETRESPERSEC; diff --git a/OpenAL32/alListener.c b/OpenAL32/alListener.c index d117c0ca..5a12673d 100644 --- a/OpenAL32/alListener.c +++ b/OpenAL32/alListener.c @@ -43,7 +43,7 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum param, ALfloat value) break; case AL_METERS_PER_UNIT: - if(!(value >= 0.0f && isfinite(value))) + if(!(value >= AL_MIN_METERS_PER_UNIT && value <= AL_MAX_METERS_PER_UNIT)) SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); context->Listener->MetersPerUnit = value; break; -- 2.11.4.GIT