[PATCH] osmo-bts[master]: DTX: fix conversion from fn to ms

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Fri Oct 7 14:48:35 UTC 2016


Review at  https://gerrit.osmocom.org/1029

DTX: fix conversion from fn to ms

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


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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 04cc800..dd34d80 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -73,8 +73,10 @@
 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;

-- 
To view, visit https://gerrit.osmocom.org/1029
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cc70cacabde98621aa892cee74f4ac461645093
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list