shithub: soundpipe

Download patch

ref: 9211d95a76975169ee7b71fc74582e5707e3fa04
parent: 70285956de156f146984f42c8ffa42401d42edd7
author: Paul Batchelor <thisispaulbatchelor@gmail.com>
date: Sat Oct 3 12:31:34 EDT 2020

removed auxmem from smoothdelay

--- a/h/smoothdelay.h
+++ b/h/smoothdelay.h
@@ -8,11 +8,11 @@
 
     uint32_t maxbuf;
 
-    sp_auxdata buf1;
+    SPFLOAT *buf1;
     uint32_t bufpos1;
     uint32_t deltime1;
 
-    sp_auxdata buf2;
+    SPFLOAT *buf2;
     uint32_t bufpos2;
     uint32_t deltime2;
     int curbuf;
--- a/modules/smoothdelay.c
+++ b/modules/smoothdelay.c
@@ -20,9 +20,8 @@
 
 int sp_smoothdelay_destroy(sp_smoothdelay **p)
 {
-    sp_smoothdelay *pp = *p;
-    sp_auxdata_free(&pp->buf1);
-    sp_auxdata_free(&pp->buf2);
+    free((*p)->buf1);
+    free((*p)->buf2);
     free(*p);
     return SP_OK;
 }
@@ -39,11 +38,11 @@
     p->maxbuf = n - 1;
     p->maxcount = interp;
 
-    sp_auxdata_alloc(&p->buf1, n * sizeof(SPFLOAT));
+    p->buf1 = calloc(1, n * sizeof(SPFLOAT));
     p->bufpos1 = 0;
     p->deltime1 = (uint32_t) (p->del * sp->sr);
 
-    sp_auxdata_alloc(&p->buf2, n * sizeof(SPFLOAT));
+    p->buf2 = calloc(1, n * sizeof(SPFLOAT));
     p->bufpos2 = 0;
     p->deltime2 = p->deltime1;
 
@@ -100,8 +99,8 @@
 
 
 
-    buf1 = (SPFLOAT *)p->buf1.ptr;
-    buf2 = (SPFLOAT *)p->buf2.ptr;
+    buf1 = p->buf1;
+    buf2 = p->buf2;
     it = (SPFLOAT)p->counter / p->maxcount;
     if (p->counter != 0) p->counter--;