aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-litecell15/tch.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-09-16 18:38:33 +0200
committerMax <msuraev@sysmocom.de>2016-09-23 14:53:46 +0000
commit80473a113d012321fa1faec24794f0b048cb1a58 (patch)
tree1c017f8f37006f835dbd529cf103f8198b00553d /src/osmo-bts-litecell15/tch.c
parent0a05181603ed7c42900f049654de007005de86f3 (diff)
DTX: fix last SID saving
Previously SID was saved explicitly by each BTS model (lc15, sysmo) instead of relying on generic function. Fix it by using generic function and propagating necessary parameters for it. Change-Id: Ie545212cce5ed2b3ea3228597f18a473f5e1deb4 Fixes: OS#1800
Diffstat (limited to 'src/osmo-bts-litecell15/tch.c')
-rw-r--r--src/osmo-bts-litecell15/tch.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c
index 187f6884..5badc4d7 100644
--- a/src/osmo-bts-litecell15/tch.c
+++ b/src/osmo-bts-litecell15/tch.c
@@ -200,7 +200,7 @@ static struct msgb *l1_to_rtppayload_amr(uint8_t *l1_payload, uint8_t payload_le
*/
static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
uint8_t payload_len,
- struct gsm_lchan *lchan)
+ struct gsm_lchan *lchan, uint32_t fn)
{
struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
enum osmo_amr_type ft;
@@ -270,14 +270,8 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
}
#endif
- if (ft == AMR_SID) {
- /* store the last SID frame in lchan context */
- unsigned int copy_len;
- copy_len = OSMO_MIN(payload_len+1,
- ARRAY_SIZE(lchan->tch.last_sid.buf));
- lchan->tch.last_sid.len = copy_len;
- memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len);
- }
+ if (ft == AMR_SID)
+ save_last_sid(lchan, l1_payload, payload_len, fn, sti);
return payload_len+1;
}
@@ -297,7 +291,7 @@ static int rtppayload_to_l1_amr(uint8_t *l1_payload, const uint8_t *rtp_payload,
* pre-fill the primtive.
*/
void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
- const uint8_t *rtp_pl, unsigned int rtp_pl_len)
+ const uint8_t *rtp_pl, unsigned int rtp_pl_len, uint32_t fn)
{
uint8_t *payload_type;
uint8_t *l1_payload;
@@ -329,7 +323,7 @@ void l1if_tch_encode(struct gsm_lchan *lchan, uint8_t *data, uint8_t *len,
case GSM48_CMODE_SPEECH_AMR:
*payload_type = GsmL1_TchPlType_Amr;
rc = rtppayload_to_l1_amr(l1_payload, rtp_pl,
- rtp_pl_len, lchan);
+ rtp_pl_len, lchan, fn);
break;
default:
/* we don't support CSD modes */