ftmod_isdn: Fix per-channel teletone buffer offset wraparound.

Do a "soft" wraparound with modulo, removes the ~0.5s tone glitch.
(Multiply ts.rate (samples) by two to match the offset unit (bytes, 2 per sample).)

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
Stefan Knoblich 2012-07-26 09:06:08 +02:00
parent 32b3f3e224
commit 5ebc68fb51
1 changed files with 1 additions and 3 deletions

View File

@ -1964,9 +1964,7 @@ static void *ftdm_isdn_tones_run(ftdm_thread_t *me, void *obj)
data->offset += rlen;
}
if (data->offset >= ts.rate) {
data->offset = 0;
}
data->offset %= (ts.rate << 1);
}
}