git ssb

0+

kode54 / syntrax-c



Commit 956789b33edb9ac8476ba6158ecad009df1d19c5

No more clicking at startup. OverlapBuff is cleared before use.

anonymous authored on 1/2/2016, 1:08:27 PM
Christopher Snowhill committed on 6/13/2018, 12:10:58 AM
Parent: 496ee5b02a58fd1f2743cf88e0424a79d9299490

Files changed

src/syntrax/syntrax.cchanged
src/syntrax/syntrax.cView
@@ -8,25 +8,16 @@
88 #include "syntrax.h"
99 #include "file.h"
1010 #include "resampler.h"
1111
12-
13-static int initVoice(Voice *v)
14-{
15- memset(v, 0, sizeof(Voice));
16- //v->
17-
18- v->resampler[0] = resampler_create();
19- v->resampler[1] = resampler_create();
20- if (!v->resampler[0] || !v->resampler[1]) return 0;
21-
22- return 1;
23-}
24-
2512 static void reset(Player *p)
2613 {
2714 int i, j;
2815
16+ if (p->overlapBuff){
17+ memset(p->overlapBuff, 0, SE_OVERLAP * 2 *2 + 2);
18+ }
19+
2920 if (p->delayBufferL && p->delayBufferR){
3021 memset(p->delayBufferL, 0, 65536 *2);
3122 memset(p->delayBufferR, 0, 65536 *2);
3223 }
@@ -192,10 +183,14 @@
192183 if (!p->voices) goto FAIL;
193184
194185 for (i = 0; i < SE_MAXCHANS; i++)
195186 {
196- //clear the damned thing up before using it
197- if (!initVoice(&p->voices[i])) goto FAIL;
187+ Voice *v = &p->voices[i];
188+ memset(v, 0, sizeof(Voice));
189+
190+ v->resampler[0] = resampler_create();
191+ v->resampler[1] = resampler_create();
192+ if (!v->resampler[0] || !v->resampler[1]) goto FAIL;
198193 }
199194
200195 reset(p);
201196

Built with git-ssb-web