aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alSource.h3
-rw-r--r--OpenAL32/Include/alu.h6
-rw-r--r--OpenAL32/alSource.c40
3 files changed, 18 insertions, 31 deletions
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 3d3f3029..7a337a89 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -114,9 +114,6 @@ typedef struct ALsource {
ALfloat GainHF;
} Send[MAX_SENDS];
- /** HRTF info. */
- HrtfState Hrtf;
-
/** Source needs to update its mixing parameters. */
volatile ALenum NeedsUpdate;
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 6b75d96f..c4baed83 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -63,7 +63,7 @@ typedef struct DirectParams {
union {
struct {
HrtfParams Params;
- HrtfState *State;
+ HrtfState State;
} Hrtf;
/* A mixing matrix. First subscript is the channel number of the input
@@ -91,11 +91,11 @@ typedef struct SendParams {
typedef void (*ResamplerFunc)(const ALfloat *src, ALuint frac, ALuint increment,
ALfloat *restrict dst, ALuint dstlen);
-typedef ALvoid (*DryMixerFunc)(const struct DirectParams *params,
+typedef ALvoid (*DryMixerFunc)(struct DirectParams *params,
const ALfloat *restrict data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo,
ALuint BufferSize);
-typedef ALvoid (*WetMixerFunc)(const struct SendParams *params,
+typedef ALvoid (*WetMixerFunc)(struct SendParams *params,
const ALfloat *restrict data,
ALuint OutPos, ALuint SamplesToDo,
ALuint BufferSize);
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 7a1d42e5..e12c9b35 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -2265,9 +2265,6 @@ static ALvoid InitSourceParams(ALsource *Source)
}
Source->NeedsUpdate = AL_TRUE;
-
- Source->Hrtf.Moving = AL_FALSE;
- Source->Hrtf.Counter = 0;
}
@@ -2293,20 +2290,6 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
BufferList = BufferList->next;
}
- if(Source->state != AL_PLAYING)
- {
- for(j = 0;j < MAX_INPUT_CHANNELS;j++)
- {
- for(k = 0;k < SRC_HISTORY_LENGTH;k++)
- Source->Hrtf.History[j][k] = 0.0f;
- for(k = 0;k < HRIR_LENGTH;k++)
- {
- Source->Hrtf.Values[j][k][0] = 0.0f;
- Source->Hrtf.Values[j][k][1] = 0.0f;
- }
- }
- }
-
if(Source->state != AL_PAUSED)
{
Source->state = AL_PLAYING;
@@ -2354,16 +2337,27 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
src->Update = CalcNonAttnSourceParams;
Context->ActiveSourceCount++;
}
+ else
+ {
+ src->Direct.Mix.Hrtf.State.Moving = AL_FALSE;
+ src->Direct.Mix.Hrtf.State.Counter = 0;
+ for(j = 0;j < MAX_INPUT_CHANNELS;j++)
+ {
+ for(k = 0;k < SRC_HISTORY_LENGTH;k++)
+ src->Direct.Mix.Hrtf.State.History[j][k] = 0.0f;
+ for(k = 0;k < HRIR_LENGTH;k++)
+ {
+ src->Direct.Mix.Hrtf.State.Values[j][k][0] = 0.0f;
+ src->Direct.Mix.Hrtf.State.Values[j][k][1] = 0.0f;
+ }
+ }
+ }
Source->NeedsUpdate = AL_TRUE;
}
else if(state == AL_PAUSED)
{
if(Source->state == AL_PLAYING)
- {
Source->state = AL_PAUSED;
- Source->Hrtf.Moving = AL_FALSE;
- Source->Hrtf.Counter = 0;
- }
}
else if(state == AL_STOPPED)
{
@@ -2371,8 +2365,6 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
{
Source->state = AL_STOPPED;
Source->BuffersPlayed = Source->BuffersInQueue;
- Source->Hrtf.Moving = AL_FALSE;
- Source->Hrtf.Counter = 0;
}
Source->Offset = -1.0;
}
@@ -2384,8 +2376,6 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
Source->position = 0;
Source->position_fraction = 0;
Source->BuffersPlayed = 0;
- Source->Hrtf.Moving = AL_FALSE;
- Source->Hrtf.Counter = 0;
}
Source->Offset = -1.0;
}