diff options
Diffstat (limited to 'src/common/l1sap.c')
-rw-r--r-- | src/common/l1sap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 04cc8006..dd34d804 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -73,8 +73,10 @@ static int l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); static uint32_t fn_ms_adj(uint32_t fn, uint32_t last_fn) { if (last_fn != LCHAN_FN_DUMMY) { - uint32_t ms_passed = GSM_FN_TO_MS(fn - last_fn), - samples_passed = GSM_MS_TO_SAMPLES(ms_passed); + /* 12/13 frames usable for audio in TCH, + 160 samples per RTP packet, + 1 RTP packet per 4 frames */ + uint32_t samples_passed = (fn - last_fn) * 12 * 160 / (13 * 4); /* round number of samples to the nearest multiple of GSM_RTP_DURATION */ uint32_t r = samples_passed + GSM_RTP_DURATION / 2; |