aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-03-11 06:20:04 -0800
committerChris Robinson <[email protected]>2017-03-11 06:20:04 -0800
commit98e8f941b773df0b591e7c6c6c0e3b5096a9b4f2 (patch)
treed09869e6f5e9f049159d26f0cd43d94c770c937a /Alc/hrtf.c
parent6b4b00e4625139157996bcf2161ec8688a4b11e8 (diff)
Allocate as many channels for DirectHrtfState as needed
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r--Alc/hrtf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index d79168e1..e1c1d7b3 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -136,7 +136,7 @@ void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth,
}
-ALsizei BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH][2], ALsizei NumChannels, const ALfloat (*restrict AmbiPoints)[2], const ALfloat (*restrict AmbiMatrix)[2][MAX_AMBI_COEFFS], ALsizei AmbiCount)
+ALsizei BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei NumChannels, const ALfloat (*restrict AmbiPoints)[2], const ALfloat (*restrict AmbiMatrix)[2][MAX_AMBI_COEFFS], ALsizei AmbiCount)
{
/* Set this to 2 for dual-band HRTF processing. May require a higher quality
* band-splitter, or better calculation of the new IR length to deal with the
@@ -206,7 +206,7 @@ ALsizei BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH]
{
ALsizei k = 0;
for(j = delay;j < HRIR_LENGTH;++j)
- coeffs[i][j][0] += temps[b][k++] * AmbiMatrix[c][b][i];
+ state->Chan[i].Coeffs[j][0] += temps[b][k++] * AmbiMatrix[c][b][i];
}
}
max_length = maxi(max_length, mini(delay + Hrtf->irSize, HRIR_LENGTH));
@@ -235,7 +235,7 @@ ALsizei BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH]
{
ALuint k = 0;
for(j = delay;j < HRIR_LENGTH;++j)
- coeffs[i][j][1] += temps[b][k++] * AmbiMatrix[c][b][i];
+ state->Chan[i].Coeffs[j][1] += temps[b][k++] * AmbiMatrix[c][b][i];
}
}
max_length = maxi(max_length, mini(delay + Hrtf->irSize, HRIR_LENGTH));