Browse Source

fix for bug I introduced with my last fix.

I left 'end' in an undefined state before.
dds
robsoles 10 years ago
parent
commit
49234c34ab
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      filter_biquad.cpp

+ 2
- 2
filter_biquad.cpp View File

@@ -34,13 +34,12 @@ void AudioFilterBiquad::update(void)
uint32_t in2, out2, aprev, bprev, flag;
uint32_t *data, *end;
int32_t *state;

block = receiveWritable();
data = (uint32_t *)(block->data);
if (!block) return;
end = data + AUDIO_BLOCK_SAMPLES/2;
state = (int32_t *)definition;
do {
data = (uint32_t *)(block->data); // needs to be done inside the loop, end need not be reset.
a0 = *state++;
a1 = *state++;
a2 = *state++;
@@ -73,6 +72,7 @@ void AudioFilterBiquad::update(void)
*state++ = sum | flag;
*(state-2) = bprev;
*(state-3) = aprev;
data = (uint32_t *)(block->data); // needs to be reset, may as well be done here
} while (flag);
transmit(block);
release(block);

Loading…
Cancel
Save