aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-06-29 17:53:49 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-10 08:44:02 +0000
commitffdc05bc4ed1171fa4306c058c45ae6a4793b2b8 (patch)
tree61f3a742642d9fed87f242e94f97a3600270ea9b /src
parentc2d3f14bfbb25d620a21a0735da49a9de0490862 (diff)
l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION
After latest changes, l2 expects to receive an event for every TCH frame, that is, no TCH frame event should be lost on that layer. We should now then be safe returning always GSM_RTP_DURATION. The code which used to calculate the variable duration is left there to assert that indeed we are not longer having this kind of issues. Change-Id: I9d112c6db142be138e71393e77129e6d069d9973
Diffstat (limited to 'src')
-rw-r--r--src/common/l1sap.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index bb27457a..3f9da4f0 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -27,6 +27,7 @@
#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <inttypes.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/l1sap.h>
@@ -87,10 +88,6 @@ static uint32_t fn_ms_adj(uint32_t fn, const struct gsm_lchan *lchan)
{
uint32_t samples_passed, r;
- /* don't adjust duration when DTX is not enabled */
- if (lchan->ts->trx->bts->dtxu == GSM48_DTX_SHALL_NOT_BE_USED)
- return GSM_RTP_DURATION;
-
if (lchan->tch.last_fn != LCHAN_FN_DUMMY) {
/* 12/13 frames usable for audio in TCH,
160 samples per RTP packet,
@@ -100,7 +97,11 @@ static uint32_t fn_ms_adj(uint32_t fn, const struct gsm_lchan *lchan)
GSM_RTP_DURATION */
r = samples_passed + GSM_RTP_DURATION / 2;
r -= r % GSM_RTP_DURATION;
- return r;
+
+ if (r != GSM_RTP_DURATION)
+ LOGP(DL1P, LOGL_ERROR, "RTP clock out of sync with lower layer:"
+ " %"PRIu32" vs %d (%"PRIu32"->%"PRIu32")\n",
+ r, GSM_RTP_DURATION, lchan->tch.last_fn, fn);
}
return GSM_RTP_DURATION;
}