diff options
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 37 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 6 |
2 files changed, 38 insertions, 5 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 9f420d35..ef852d13 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -61,6 +61,43 @@ static __inline ALfloat lpFilter1P(FILTER *iir, ALuint offset, ALfloat input) return output; } +static __inline ALfloat lpFilter4PC(const FILTER *iir, ALuint offset, ALfloat input) +{ + const ALfloat *history = &iir->history[offset]; + ALfloat a = iir->coeff; + ALfloat output = input; + + output = output + (history[0]-output)*a; + output = output + (history[1]-output)*a; + output = output + (history[2]-output)*a; + output = output + (history[3]-output)*a; + + return output; +} + +static __inline ALfloat lpFilter2PC(const FILTER *iir, ALuint offset, ALfloat input) +{ + const ALfloat *history = &iir->history[offset]; + ALfloat a = iir->coeff; + ALfloat output = input; + + output = output + (history[0]-output)*a; + output = output + (history[1]-output)*a; + + return output; +} + +static __inline ALfloat lpFilter1PC(FILTER *iir, ALuint offset, ALfloat input) +{ + const ALfloat *history = &iir->history[offset]; + ALfloat a = iir->coeff; + ALfloat output = input; + + output = output + (history[0]-output)*a; + + return output; +} + /* Calculates the low-pass filter coefficient given the pre-scaled gain and * cos(w) value. Note that g should be pre-scaled (sqr(gain) for one-pole, * sqrt(gain) for four-pole, etc) */ diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 1e320e19..5435e5d0 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -1366,11 +1366,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources) if(Source->lOffset) ApplyOffset(Source); - if(Source->BuffersPlayed == 0 && Source->position == 0 && - Source->position_fraction == 0) - Source->FirstStart = AL_TRUE; - else - Source->FirstStart = AL_FALSE; + Source->FirstStart = AL_TRUE; // If device is disconnected, go right to stopped if(!Context->Device->Connected) |