diff options
author | Chris Robinson <[email protected]> | 2012-02-19 13:09:29 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-02-19 13:09:29 -0800 |
commit | 418c76649346876fd99b0d091201bbad61c604fd (patch) | |
tree | 5bc8732d8cbf94944a38721aeb856c3eca2b3cc0 | |
parent | 4a65747a4b20cbbfb2627bf10ded6f5b897cb908 (diff) |
Use memset to clear the bs2b filter's last sample and remove the unused is_clear function
-rw-r--r-- | Alc/bs2b.c | 20 | ||||
-rw-r--r-- | OpenAL32/Include/bs2b.h | 3 |
2 files changed, 2 insertions, 21 deletions
@@ -24,6 +24,7 @@ #include "config.h" #include <math.h> +#include <string.h> #include "bs2b.h" @@ -147,26 +148,9 @@ int bs2b_get_srate(struct bs2b *bs2b) void bs2b_clear(struct bs2b *bs2b) { - int loopv = sizeof(bs2b->last_sample); - - while (loopv) - { - ((char *)&bs2b->last_sample)[--loopv] = 0; - } + memset(&bs2b->last_sample, 0, sizeof(bs2b->last_sample)); } /* bs2b_clear */ -int bs2b_is_clear(struct bs2b *bs2b) -{ - int loopv = sizeof(bs2b->last_sample); - - while (loopv) - { - if (((char *)&bs2b->last_sample)[--loopv] != 0) - return 0; - } - return 1; -} /* bs2b_is_clear */ - void bs2b_cross_feed(struct bs2b *bs2b, float *sample) { /* Lowpass filter */ diff --git a/OpenAL32/Include/bs2b.h b/OpenAL32/Include/bs2b.h index 3e5cd83c..0f06b1ca 100644 --- a/OpenAL32/Include/bs2b.h +++ b/OpenAL32/Include/bs2b.h @@ -91,9 +91,6 @@ int bs2b_get_srate(struct bs2b *bs2b); /* Clear buffer */ void bs2b_clear(struct bs2b *bs2b); -/* Return 1 if buffer is clear */ -int bs2b_is_clear(struct bs2b *bs2b); - /* Crossfeeds one stereo sample that are pointed by sample. * [0] - first channel, [1] - second channel. * Returns crossfided samle by sample pointer. |