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:
parent
32b3f3e224
commit
5ebc68fb51
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue