From c92810eccd491b9dfc7b1c2bb4dbc599ff04e9fe Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 12 Feb 2013 17:23:29 +0100 Subject: [PATCH] osmux: remove arrays from osmux_out_handle there will be one osmux_out_handle per endpoint. --- include/osmocom/netif/osmux.h | 4 ++-- src/osmux.c | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h index 20b6123..d7ebf55 100644 --- a/include/osmocom/netif/osmux.h +++ b/include/osmocom/netif/osmux.h @@ -52,8 +52,8 @@ struct osmux_in_handle { /* one per OSmux circuit_id, ie. one per RTP flow. */ struct osmux_out_handle { - uint16_t rtp_seq[OSMUX_MAX_CONCURRENT_CALLS]; - uint32_t rtp_timestamp[OSMUX_MAX_CONCURRENT_CALLS]; + uint16_t rtp_seq; + uint32_t rtp_timestamp; }; static inline uint8_t *osmux_get_payload(struct osmux_hdr *osmuxh) diff --git a/src/osmux.c b/src/osmux.c index d1295d1..2775bfa 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -73,8 +73,8 @@ osmux_rebuild_rtp(struct osmux_out_handle *h, rtph->version = RTP_VERSION; rtph->payload_type = 98; /* ... emulate timestamp and ssrc */ - rtph->timestamp = htonl(h->rtp_timestamp[osmuxh->circuit_id]); - rtph->sequence = htons(h->rtp_seq[osmuxh->circuit_id]); + rtph->timestamp = htonl(h->rtp_timestamp); + rtph->sequence = htons(h->rtp_seq); rtph->ssrc = htonl(ssrc_from_ccid); msgb_put(out_msg, sizeof(struct rtp_hdr)); @@ -93,8 +93,8 @@ osmux_rebuild_rtp(struct osmux_out_handle *h, msgb_put(out_msg, payload_len); /* bump last RTP sequence number and timestamp that has been used */ - h->rtp_seq[osmuxh->circuit_id]++; - h->rtp_timestamp[osmuxh->circuit_id] += DELTA_RTP_TIMESTAMP; + h->rtp_seq++; + h->rtp_timestamp += DELTA_RTP_TIMESTAMP; osmo_rtp_snprintf(buf, sizeof(buf), out_msg); LOGP(DLMIB, LOGL_DEBUG, "%s\n", buf); @@ -499,10 +499,6 @@ osmux_tx_sched(struct llist_head *list, void osmux_xfrm_output_init(struct osmux_out_handle *h) { - int i; - - for (i=0; irtp_seq[i] = (uint16_t)random(); - h->rtp_timestamp[i] = (uint32_t)random(); - } + h->rtp_seq = (uint16_t)random(); + h->rtp_timestamp = (uint32_t)random(); }