diff --git a/aucat/dsp.c b/aucat/dsp.c index e4669a2..6203fb3 100644 --- a/aucat/dsp.c +++ b/aucat/dsp.c @@ -14,6 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include "dsp.h" #include "utils.h" @@ -403,7 +404,7 @@ void resamp_init(struct resamp *p, unsigned int iblksz, unsigned int oblksz, int nch) { - unsigned int i, g; + unsigned int g; /* * reduce iblksz/oblksz fraction @@ -425,8 +426,7 @@ resamp_init(struct resamp *p, unsigned int iblksz, p->diff = 0; p->nch = nch; p->ctx_start = 0; - for (i = 0; i < NCHAN_MAX * RESAMP_NCTX; i++) - p->ctx[i] = 0; + memset(p->ctx, 0, sizeof(p->ctx)); #ifdef DEBUG if (log_level >= 3) { log_puts("resamp: "); diff --git a/sndiod/dsp.c b/sndiod/dsp.c index 3e80a2b..6be0dd3 100644 --- a/sndiod/dsp.c +++ b/sndiod/dsp.c @@ -268,14 +268,11 @@ void resamp_init(struct resamp *p, unsigned int iblksz, unsigned int oblksz, int nch) { - unsigned int i; - p->iblksz = iblksz; p->oblksz = oblksz; p->nch = nch; p->ctx_start = 0; - for (i = 0; i < NCHAN_MAX * RESAMP_NCTX; i++) - p->ctx[i] = 0; + memset(p->ctx, 0, sizeof(p->ctx)); #ifdef DEBUG if (log_level >= 3) { log_puts("resamp: ");