aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-03-22 08:56:48 -0700
committerChris Robinson <[email protected]>2018-03-22 08:56:48 -0700
commit1d6622aa2b2408a18c010d40974a3f3f83ced962 (patch)
treeaa800f2b6c3f7583e15e71881e2249007adc50c0 /Alc
parenteeff730034de1f637e82c4391eb945337dc8a5ce (diff)
Fix a delta phase offset calculation in the pitch shifter
tmp can be negative, and &1 is not the same as %2 in that case.
Diffstat (limited to 'Alc')
-rw-r--r--Alc/effects/pshifter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Alc/effects/pshifter.c b/Alc/effects/pshifter.c
index ee6ca806..4597da6b 100644
--- a/Alc/effects/pshifter.c
+++ b/Alc/effects/pshifter.c
@@ -309,7 +309,7 @@ static ALvoid ALpshifterState_process(ALpshifterState *state, ALsizei SamplesToD
/* Map delta phase into +/- Pi interval */
j = fastf2i(tmp / F_PI);
- tmp -= F_PI * (ALfloat)(j + (j&1));
+ tmp -= F_PI * (ALfloat)(j + (j%2));
/* Get deviation from bin frequency from the +/- Pi interval */
tmp /= expected;