From 88eae20dc2ac0e634f88df31c43b418451166670 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 15 Dec 2013 22:35:28 +0100 Subject: 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. --- src/osmux.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') 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; -- cgit v1.2.3