Explorar el Código

fix for bug I introduced with my last fix.

I left 'end' in an undefined state before.
dds
robsoles hace 11 años
padre
commit
49234c34ab
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. +2
    -2
      filter_biquad.cpp

+ 2
- 2
filter_biquad.cpp Ver fichero

@@ -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);

Cargando…
Cancelar
Guardar