aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-litecell15/tch.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-09-28 16:25:13 +0200
committerMax <msuraev@sysmocom.de>2016-09-30 16:50:47 +0200
commit7dffd553df0ca48f52d6faca70aa3e9cf2760840 (patch)
treeead12cc877a81d613320fc1f74a5ef319d821f72 /src/osmo-bts-litecell15/tch.c
parent94fa25295f090cc6190ae7c96df946a3979f05cc (diff)
DTX: move scheduling check inside repeat_last_sid
Note: this also require changes to properly link against libosmocodec - see 2bb65be159dfdabf664fec569b343320301701b0 in libosmocore. Change-Id: I96594cf3aa1013d505bd20069d5bf261d9a2aefb
Diffstat (limited to 'src/osmo-bts-litecell15/tch.c')
-rw-r--r--src/osmo-bts-litecell15/tch.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c
index bcf981e4..5ec1ee74 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -35,7 +35,6 @@
#include <osmocom/core/select.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/bits.h>
-#include <osmocom/codec/codec.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/trau/osmo_ortp.h>
@@ -492,6 +491,7 @@ struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn)
GsmL1_MsgUnitParam_t *msu_param;
uint8_t *payload_type;
uint8_t *l1_payload;
+ int rc;
msg = l1p_msgb_alloc();
if (!msg)
@@ -506,43 +506,27 @@ struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn)
switch (lchan->tch_mode) {
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
- if (dtx_amr_sid_optional(lchan, fn)) {
- msgb_free(msg);
- return NULL;
- }
- msu_param->u8Size = repeat_last_sid(lchan, l1_payload, fn);
- if (!msu_param->u8Size)
- osmo_amr_rtp_enc(l1_payload, 0, AMR_NO_DATA, AMR_GOOD);
break;
case GSM48_CMODE_SPEECH_V1:
if (lchan->type == GSM_LCHAN_TCH_F)
*payload_type = GsmL1_TchPlType_Fr;
else
*payload_type = GsmL1_TchPlType_Hr;
- /* unlike AMR, FR & HR schedued based on absolute FN value */
- if (dtx_sched_optional(lchan, fn)) {
- msgb_free(msg);
- return NULL;
- }
- msu_param->u8Size = repeat_last_sid(lchan, l1_payload, fn);
- if (!msu_param->u8Size)
- return NULL;
break;
case GSM48_CMODE_SPEECH_EFR:
*payload_type = GsmL1_TchPlType_Efr;
- if (dtx_sched_optional(lchan, fn)) {
- msgb_free(msg);
- return NULL;
- }
- msu_param->u8Size = repeat_last_sid(lchan, l1_payload, fn);
- if (!msu_param->u8Size)
- return NULL;
break;
default:
msgb_free(msg);
- msg = NULL;
- break;
+ return NULL;
+ }
+
+ rc = repeat_last_sid(lchan, l1_payload, fn);
+ if (!rc) {
+ msgb_free(msg);
+ return NULL;
}
+ msu_param->u8Size = rc;
return msg;
}