Change in osmo-bts[master]: l1sap: fix TDMA frame number arithmetic in fn_ms_adj()

fixeria gerrit-no-reply at lists.osmocom.org
Mon Jun 7 20:29:46 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/24601 )


Change subject: l1sap: fix TDMA frame number arithmetic in fn_ms_adj()
......................................................................

l1sap: fix TDMA frame number arithmetic in fn_ms_adj()

Using the normal arithmetic for TDMA frame numbers is wrong.

Change-Id: Ie17670d150489014a4a2e140cede42086100bbc0
---
M src/common/l1sap.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/24601/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index cd2af57..1e302ce 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -139,7 +139,8 @@
 		/* 12/13 frames usable for audio in TCH,
 		   160 samples per RTP packet,
 		   1 RTP packet per 4 frames */
-		samples_passed = (fn - lchan->tch.last_fn) * 12 * 160 / (13 * 4);
+		samples_passed = GSM_TDMA_FN_SUB(fn, lchan->tch.last_fn);
+		samples_passed = samples_passed * 12 * 160 / (13 * 4);
 		/* round number of samples to the nearest multiple of
 		   GSM_RTP_DURATION */
 		r = samples_passed + GSM_RTP_DURATION / 2;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24601
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie17670d150489014a4a2e140cede42086100bbc0
Gerrit-Change-Number: 24601
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210607/d1b3d8cb/attachment.htm>


More information about the gerrit-log mailing list