mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-24 16:43:39 +00:00
remove strange loop for non-existant transcoding support
The existing support preparing the mgw for transcoding (which doesn't exist) has some kind of method where the transcoding function might be called multiple times in a row. However, as it is not used, it is not entirely clear how it was intended to work. Let's remove this unused looping feature which makes it hard to understand how upcoming osmo_io should deal with it. Change-Id: Ie1a629fd31c5ab806fc929d1e6b279c4be5b8246
This commit is contained in:
@@ -1167,41 +1167,38 @@ int mgcp_send(struct mgcp_endpoint *endp, int is_rtp, struct osmo_sockaddr *addr
|
|||||||
osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port)
|
osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port)
|
||||||
);
|
);
|
||||||
} else if (is_rtp) {
|
} else if (is_rtp) {
|
||||||
int cont;
|
|
||||||
int nbytes = 0;
|
|
||||||
int buflen = msgb_length(msg);
|
int buflen = msgb_length(msg);
|
||||||
|
|
||||||
/* Make sure we have a valid RTP header, in cases where no RTP
|
/* Make sure we have a valid RTP header, in cases where no RTP
|
||||||
* header is present, we will generate one. */
|
* header is present, we will generate one. */
|
||||||
gen_rtp_header(msg, rtp_end, rtp_state);
|
gen_rtp_header(msg, rtp_end, rtp_state);
|
||||||
|
|
||||||
do {
|
|
||||||
/* Run transcoder */
|
/* Run transcoder */
|
||||||
cont = endp->trunk->cfg->rtp_processing_cb(endp, rtp_end, (char *)msgb_data(msg), &buflen, RTP_BUF_SIZE);
|
rc = endp->trunk->cfg->rtp_processing_cb(endp, rtp_end, (char *)msgb_data(msg), &buflen, RTP_BUF_SIZE);
|
||||||
if (cont < 0)
|
if (rc < 0) {
|
||||||
break;
|
LOGPENDP(endp, DRTP, LOGL_ERROR, "Error %d during transcoding\n", rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
if (addr)
|
if (addr)
|
||||||
mgcp_patch_and_count(endp, rtp_state, rtp_end,
|
mgcp_patch_and_count(endp, rtp_state, rtp_end, addr, msg);
|
||||||
addr, msg);
|
|
||||||
|
|
||||||
if (mgcp_conn_rtp_is_iuup(conn_dst) || mgcp_conn_rtp_is_iuup(conn_src)) {
|
if (mgcp_conn_rtp_is_iuup(conn_dst) || mgcp_conn_rtp_is_iuup(conn_src)) {
|
||||||
/* the iuup code will correctly transform to the correct AMR mode */
|
/* the iuup code will correctly transform to the correct AMR mode */
|
||||||
} else if (mgcp_codec_amr_align_mode_is_indicated(conn_dst->end.codec)) {
|
} else if (mgcp_codec_amr_align_mode_is_indicated(conn_dst->end.codec)) {
|
||||||
rc = amr_oa_bwe_convert(endp, msg,
|
rc = amr_oa_bwe_convert(endp, msg, conn_dst->end.codec->param.amr_octet_aligned);
|
||||||
conn_dst->end.codec->param.amr_octet_aligned);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
LOGPENDP(endp, DRTP, LOGL_ERROR,
|
LOGPENDP(endp, DRTP, LOGL_ERROR,
|
||||||
"Error in AMR octet-aligned <-> bandwidth-efficient mode conversion (target=%s)\n",
|
"Error in AMR octet-aligned <-> bandwidth-efficient mode conversion (target=%s)\n",
|
||||||
conn_dst->end.codec->param.amr_octet_aligned ? "octet-aligned" : "bandwidth-efficient");
|
conn_dst->end.codec->param.amr_octet_aligned ? "octet-aligned" : "bandwidth-efficient");
|
||||||
break;
|
return rc;
|
||||||
}
|
}
|
||||||
} else if (rtp_end->rfc5993_hr_convert &&
|
} else if (rtp_end->rfc5993_hr_convert &&
|
||||||
strcmp(conn_src->end.codec->subtype_name, "GSM-HR-08") == 0) {
|
strcmp(conn_src->end.codec->subtype_name, "GSM-HR-08") == 0) {
|
||||||
rc = rfc5993_hr_convert(endp, msg);
|
rc = rfc5993_hr_convert(endp, msg);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
LOGPENDP(endp, DRTP, LOGL_ERROR, "Error while converting to GSM-HR-08\n");
|
LOGPENDP(endp, DRTP, LOGL_ERROR, "Error while converting to GSM-HR-08\n");
|
||||||
break;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1227,10 +1224,7 @@ int mgcp_send(struct mgcp_endpoint *endp, int is_rtp, struct osmo_sockaddr *addr
|
|||||||
rtpconn_rate_ctr_add(conn_dst, endp, RTP_OCTETS_TX_CTR, len);
|
rtpconn_rate_ctr_add(conn_dst, endp, RTP_OCTETS_TX_CTR, len);
|
||||||
rtp_state->alt_rtp_tx_sequence++;
|
rtp_state->alt_rtp_tx_sequence++;
|
||||||
|
|
||||||
nbytes += len;
|
return len;
|
||||||
buflen = cont;
|
|
||||||
} while (buflen > 0);
|
|
||||||
return nbytes;
|
|
||||||
} else if (!trunk->omit_rtcp) {
|
} else if (!trunk->omit_rtcp) {
|
||||||
struct osmo_sockaddr rtcp_addr = rtp_end->addr;
|
struct osmo_sockaddr rtcp_addr = rtp_end->addr;
|
||||||
osmo_sockaddr_set_port(&rtcp_addr.u.sa, rtp_end->rtcp_port);
|
osmo_sockaddr_set_port(&rtcp_addr.u.sa, rtp_end->rtcp_port);
|
||||||
|
|||||||
Reference in New Issue
Block a user