osmux: remove arrays from osmux_out_handle

there will be one osmux_out_handle per endpoint.
This commit is contained in:
Pablo Neira Ayuso 2013-02-12 17:23:29 +01:00
parent 7ff7a5cd6d
commit c92810eccd
2 changed files with 8 additions and 12 deletions

View File

@ -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)

View File

@ -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();
}