aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2013-12-15 22:35:28 +0100
committerPablo Neira Ayuso <pablo@gnumonks.org>2013-12-15 22:35:28 +0100
commit88eae20dc2ac0e634f88df31c43b418451166670 (patch)
tree20eac395a62a6d919ccd7969e7762d9c57462f4b /src
parent84fffecba5f172aa66fa363e0e37e0ad43c4f3b6 (diff)
osmux: pass rtp header to osmux_batch_add()
This patch is a cleanup. Pass the pointer to the header, so we don't need to obtain it from the message buffer again.
Diffstat (limited to 'src')
-rw-r--r--src/osmux.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/osmux.c b/src/osmux.c
index 0acffd7..a385d22 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -380,9 +380,9 @@ static void osmux_replay_lost_packets(struct batch_list_node *node,
}
static int
-osmux_batch_add(struct osmux_batch *batch, struct msgb *msg, int ccid)
+osmux_batch_add(struct osmux_batch *batch, struct msgb *msg,
+ struct rtp_hdr *rtph, int ccid)
{
- struct rtp_hdr *rtph;
struct batch_list_node *node;
int found = 0, bytes = 0, amr_payload_len;
@@ -393,10 +393,6 @@ osmux_batch_add(struct osmux_batch *batch, struct msgb *msg, int ccid)
}
}
- rtph = osmo_rtp_get_hdr(msg);
- if (rtph == NULL)
- return 0;
-
amr_payload_len = osmux_rtp_amr_payload_len(msg, rtph);
if (amr_payload_len < 0)
return 0;
@@ -493,7 +489,7 @@ int osmux_xfrm_input(struct osmux_in_handle *h, struct msgb *msg, int ccid)
first_rtp_msg = llist_empty(&batch->node_list) ? 1 : 0;
/* Add this RTP to the OSMUX batch */
- ret = osmux_batch_add(batch, msg, ccid);
+ ret = osmux_batch_add(batch, msg, rtph, ccid);
if (ret < 0)
return 0;