aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-03-04 16:18:03 -0800
committerChris Robinson <[email protected]>2011-03-04 16:18:03 -0800
commit97139a530fb624e6e1f55f410e0b122fbb4ad516 (patch)
tree008df34d840200e2205108172e950046120dcf90
parentb483b1e380db9d4363a7eeaa4f2fe3a6f4a80c93 (diff)
Filter NaN sample values when converting floats and doubles
-rw-r--r--OpenAL32/alBuffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index cb5a9288..f56b749e 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -1156,9 +1156,9 @@ static __inline ALfloat Conv_ALfloat_ALint(ALint val)
static __inline ALfloat Conv_ALfloat_ALuint(ALuint val)
{ return (ALint)(val-2147483648u) * (1.0/2147483647.0); }
static __inline ALfloat Conv_ALfloat_ALfloat(ALfloat val)
-{ return val; }
+{ return (val==val) ? val : 0.0f; }
static __inline ALfloat Conv_ALfloat_ALdouble(ALdouble val)
-{ return val; }
+{ return (val==val) ? val : 0.0; }
static __inline ALfloat Conv_ALfloat_ALmulaw(ALmulaw val)
{ return Conv_ALfloat_ALshort(DecodeMuLaw(val)); }
@@ -1175,9 +1175,9 @@ static __inline ALdouble Conv_ALdouble_ALint(ALint val)
static __inline ALdouble Conv_ALdouble_ALuint(ALuint val)
{ return (ALint)(val-2147483648u) * (1.0/2147483647.0); }
static __inline ALdouble Conv_ALdouble_ALfloat(ALfloat val)
-{ return val; }
+{ return (val==val) ? val : 0.0f; }
static __inline ALdouble Conv_ALdouble_ALdouble(ALdouble val)
-{ return val; }
+{ return (val==val) ? val : 0.0; }
static __inline ALdouble Conv_ALdouble_ALmulaw(ALmulaw val)
{ return Conv_ALdouble_ALshort(DecodeMuLaw(val)); }