ref: 264e4718c21792ed8ee230d39aa2b9ac88d73b14
parent: bbfeadd2e4c2c311ed1a71548c0faafc874a9afa
author: Paul Batchelor <[email protected]>
date: Mon Oct 5 15:41:21 EDT 2020
removed auxdata from spa
--- a/h/spa.h
+++ b/h/spa.h
@@ -3,7 +3,6 @@
uint32_t pos;
uint32_t bufsize;
sp_audio spa;
- sp_auxdata aux;
} sp_spa;
int sp_spa_create(sp_spa **p);
--- a/modules/spa.c
+++ b/modules/spa.c
@@ -14,8 +14,8 @@
int sp_spa_destroy(sp_spa **p)
{
sp_spa *pp = *p;
- sp_auxdata_free(&pp->aux);
spa_close(&pp->spa);
+ free(pp->buf);
free(*p);
return SP_OK;
}
@@ -29,21 +29,19 @@
p->pos = 0;
p->bufsize = SPA_BUFSIZE;
- sp_auxdata_alloc(&p->aux, sizeof(SPFLOAT) * p->bufsize);
+ p->buf = calloc(1, sizeof(SPFLOAT) * p->bufsize);
- p->buf = p->aux.ptr;
-
return SP_OK;
}
int sp_spa_compute(sp_data *sp, sp_spa *p, SPFLOAT *in, SPFLOAT *out)
{
- if(p->bufsize == 0) {
+ if (p->bufsize == 0) {
*out = 0.0;
return SP_OK;
}
- if(p->pos == 0) {
+ if (p->pos == 0) {
p->bufsize = spa_read_buf(sp, &p->spa, p->buf, SPA_BUFSIZE);
if(p->bufsize == 0) {
*out = 0.0;