aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2013-05-20 22:34:51 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2013-05-20 22:37:31 +0200
commita9ab95c2c4efae10119212dcc18b046afe9601f4 (patch)
treeb69373d9ec2c9234e9196941e8942a1f324714db /src
parenta2c7f909ef930f7ca098fc5e4b97255dd90878ba (diff)
osmux: use ccid to identify batches instead of the RTP SSRC
This should reduce the amount of batch nodes that are created by the maximum number of allowed circuit IDs.
Diffstat (limited to 'src')
-rw-r--r--src/osmux.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/osmux.c b/src/osmux.c
index 8213525..c8e8557 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -222,7 +222,6 @@ osmux_xfrm_encode_amr(struct osmux_in_handle *h,
struct batch_list_node {
struct llist_head head;
- uint32_t ssrc;
int ccid;
struct llist_head list;
};
@@ -313,18 +312,17 @@ osmux_batch_add(struct osmux_batch *batch, struct msgb *msg, int ccid)
struct batch_list_node *node;
int found = 0, bytes = 0;
- rtph = osmo_rtp_get_hdr(msg);
- if (rtph == NULL)
- return 0;
-
- /* Yes, there is room. Check if we have more message with same ssrc */
llist_for_each_entry(node, &batch->node_list, head) {
- if (node->ssrc == rtph->ssrc) {
+ if (node->ccid == ccid) {
found = 1;
break;
}
}
+ rtph = osmo_rtp_get_hdr(msg);
+ if (rtph == NULL)
+ return 0;
+
/* First check if there is room for this message in the batch */
bytes += osmux_rtp_amr_payload_len(msg, rtph);
if (!found)
@@ -361,7 +359,6 @@ osmux_batch_add(struct osmux_batch *batch, struct msgb *msg, int ccid)
return 0;
node->ccid = ccid;
- node->ssrc = rtph->ssrc;
INIT_LLIST_HEAD(&node->list);
llist_add_tail(&node->head, &batch->node_list);
}