Commit 3a44c2f
committed
Fix inputBuffer free
Non-interleaved support was added in f229c7b
Previous to this commit, the default was interleaved, meaning there was only ever one mBuffers.
With non-interleaved support, there are numberOfChannels mBuffers.
The allocation of these buffers is shown in createInputBuffer wherein
if (interleaved) {
...
inputBuffer->mBuffers[0].mData = calloc(1, MAXFRAMES * 4 * numberOfChannels);
...
} else {
inputBuffer = (AudioBufferList *)malloc(offsetof(AudioBufferList, mBuffers[0]) + sizeof(AudioBuffer) * numberOfChannels);
...
for (int n = 0; n < numberOfChannels; n++) {
inputBuffer->mBuffers[n].mData = inputBufs[n] = (float *)calloc(1, MAXFRAMES * 4);
...
}
}
Therefore when freeing inputBuffer, interleaved == true should free one mBuffers
and interleaved == false should free numberOfChannels mBuffers.1 parent c662ecf commit 3a44c2f
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
0 commit comments