diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h index dd89973..f52fcb4 100644 --- a/include/osmocom/netif/osmux.h +++ b/include/osmocom/netif/osmux.h @@ -47,10 +47,12 @@ struct osmux_in_handle { char *data; /* internal data */ }; +#define OSMUX_MAX_CONCURRENT_CALLS 8 + /* one per OSmux circuit_id, ie. one per RTP flow. */ struct osmux_out_handle { - uint16_t rtp_seq[8]; - uint32_t rtp_timestamp[8]; + uint16_t rtp_seq[OSMUX_MAX_CONCURRENT_CALLS]; + uint32_t rtp_timestamp[OSMUX_MAX_CONCURRENT_CALLS]; }; static inline uint8_t *osmux_get_payload(struct osmux_hdr *osmuxh) diff --git a/src/osmux.c b/src/osmux.c index ad18c36..5916edc 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -385,7 +385,7 @@ void osmux_xfrm_input_init(struct osmux_in_handle *h) batch->timer.cb = osmux_batch_timer_expired; batch->timer.data = h; - for (i=0; i<8; i++) + for (i=0; iccid[i] = -1; h->data = (void *)batch; @@ -475,7 +475,7 @@ void osmux_xfrm_input_register_ccid(struct osmux_in_handle *h, uint32_t ssrc) struct osmux_batch *batch = (struct osmux_batch *)h->data;; int i, found = 0; - for (i=0; i<8; i++) { + for (i=0; iccid[i] == ssrc) continue; if (batch->ccid[i] < 0) { @@ -498,7 +498,7 @@ int osmux_xfrm_input_get_ccid(struct osmux_in_handle *h, uint32_t ssrc) struct osmux_batch *batch = (struct osmux_batch *)h->data;; int i, found = 0; - for (i=0; i<8; i++) { + for (i=0; iccid[i] == ssrc) { found = 1; break; @@ -512,7 +512,7 @@ void osmux_xfrm_output_init(struct osmux_out_handle *h) { int i; - for (i=0; i<8; i++) { + for (i=0; irtp_seq[i] = (uint16_t)random(); h->rtp_timestamp[i] = (uint32_t)random(); }