aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2013-02-12 17:23:29 +0100
committerPablo Neira Ayuso <pablo@gnumonks.org>2013-02-12 17:24:13 +0100
commitc92810eccd491b9dfc7b1c2bb4dbc599ff04e9fe (patch)
tree7e4493bbd64cb3e551acd014f0904a1b6a0f3b4d
parent7ff7a5cd6da3ce40b4cb9daea90948a1ec1495e1 (diff)
osmux: remove arrays from osmux_out_handle
there will be one osmux_out_handle per endpoint.
-rw-r--r--include/osmocom/netif/osmux.h4
-rw-r--r--src/osmux.c16
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; i<OSMUX_MAX_CONCURRENT_CALLS; i++) {
- h->rtp_seq[i] = (uint16_t)random();
- h->rtp_timestamp[i] = (uint32_t)random();
- }
+ h->rtp_seq = (uint16_t)random();
+ h->rtp_timestamp = (uint32_t)random();
}