From c03d3ae7af27edc035316f9d21aab5437f934b07 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 23 Jun 2016 17:59:51 +0200 Subject: DTXu: move copy-pasted code to common part Abstract code for checking/setting lchan's UL SID flag and RTP Marker into generic function and use it for LC15 and sysmoBTS. Change-Id: Ica5392e92bab29164711163e7b01adb174272883 Related: OS#1750 --- src/osmo-bts-litecell15/tch.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'src/osmo-bts-litecell15/tch.c') diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index ec43c107..b061fe93 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -108,12 +108,7 @@ static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len cur = msgb_put(msg, GSM_FR_BYTES); memcpy(cur, l1_payload, GSM_FR_BYTES); - if (osmo_fr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan); return msg; } @@ -151,12 +146,8 @@ static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, uint8_t cmr; int8_t sti, cmi; osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); - if (ft == AMR_GSM_EFR_SID) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan); + return msg; } @@ -187,12 +178,7 @@ static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len cur = msgb_put(msg, GSM_HR_BYTES); memcpy(cur, l1_payload, GSM_HR_BYTES); - if (osmo_hr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_hr_check_sid(l1_payload, payload_len), lchan); return msg; } -- cgit v1.2.3