summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-31 01:00:01 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-08-31 01:00:01 +0200
commitf192a6c4290a2da79ae1479397b0f58d444e8587 (patch)
tree684be0c6b5e576882662d34eb0035c7220a0fadc
parent425e7381d758e5131efb55a0c475566039f663d5 (diff)
rtp: Add 5.15kb RTP mode... 15 byte per sample for 5.15kb mode
-rw-r--r--openbsc/src/libmgcp/rtp_helper.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/libmgcp/rtp_helper.c b/openbsc/src/libmgcp/rtp_helper.c
index d1c356c..ad6dc06 100644
--- a/openbsc/src/libmgcp/rtp_helper.c
+++ b/openbsc/src/libmgcp/rtp_helper.c
@@ -89,8 +89,12 @@ static int guess_amr_size(const uint8_t *_data)
{
const struct amr_toc *toc;
toc = (struct amr_toc *) _data;
+ /* SID */
if (toc->ft_bits == 8 && toc->f_bit == 0 && toc->q_bit == 1)
return 7;
+ /* 5.15 */
+ if (toc->ft_bits == 1 && toc->f_bit == 0 && toc->q_bit == 1)
+ return 15;
return 17;
}
@@ -317,9 +321,9 @@ int rtp_compress(struct mgcp_rtp_compr_state *state, struct msgb *msg,
}
payload_len = msgb_l2len(rtp) - sizeof(struct rtp_hdr);
- if (payload_len != 7 && payload_len != 17) {
+ if (payload_len != 7 && payload_len != 17 && payload_len != 15) {
LOGP(DMGCP, LOGL_ERROR,
- "We assume every payload is 17 or 7 byte: %d\n",
+ "We assume every payload is 17,7,5 byte: %d\n",
msgb_l2len(rtp) - sizeof(struct rtp_hdr));
llist_del(&rtp->list);
talloc_free(rtp);