mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-25 20:19:36 +00:00
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;
|
data->offset += rlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->offset >= ts.rate) {
|
data->offset %= (ts.rate << 1);
|
||||||
data->offset = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user