Commit 956789b33edb9ac8476ba6158ecad009df1d19c5
No more clicking at startup. OverlapBuff is cleared before use.
anonymous authored on 1/2/2016, 1:08:27 PMChristopher Snowhill committed on 6/13/2018, 12:10:58 AM
Parent: 496ee5b02a58fd1f2743cf88e0424a79d9299490
Files changed
src/syntrax/syntrax.c | changed |
src/syntrax/syntrax.c | ||
---|---|---|
@@ -8,25 +8,16 @@ | ||
8 | 8 | |
9 | 9 | |
10 | 10 | |
11 | 11 | |
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 | - | |
25 | 12 | static void reset(Player *p) |
26 | 13 | { |
27 | 14 | int i, j; |
28 | 15 | |
16 | + if (p->overlapBuff){ | |
17 | + memset(p->overlapBuff, 0, SE_OVERLAP * 2 *2 + 2); | |
18 | + } | |
19 | + | |
29 | 20 | if (p->delayBufferL && p->delayBufferR){ |
30 | 21 | memset(p->delayBufferL, 0, 65536 *2); |
31 | 22 | memset(p->delayBufferR, 0, 65536 *2); |
32 | 23 | } |
@@ -192,10 +183,14 @@ | ||
192 | 183 | if (!p->voices) goto FAIL; |
193 | 184 | |
194 | 185 | for (i = 0; i < SE_MAXCHANS; i++) |
195 | 186 | { |
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; | |
198 | 193 | } |
199 | 194 | |
200 | 195 | reset(p); |
201 | 196 |
Built with git-ssb-web