diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-04 20:56:53 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-04 20:56:53 +0200 |
commit | 81979fa80a814ece2c6a7f3f8a7a85822758cad5 (patch) | |
tree | 05a03c24d3ccdda9ffaabc3a469e1dddcc3d8ec7 /src | |
parent | 082d700a8f66d74efcbb967116b22075b5c67caf (diff) |
osmux: fix when to add the osmux header
This needs to be done for the first message in one RTP SSRC series.
Before this patch, it was always included due to wrong aritmethics.
Diffstat (limited to 'src')
-rw-r--r-- | src/osmux.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/osmux.c b/src/osmux.c index b1aaf6e..2132a91 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -212,15 +212,19 @@ static struct msgb *osmux_build_batch(void) llist_for_each_entry_safe(cur, tmp, &batch.msgb_list, list) { struct rtp_hdr *rtph; - LOGP(DOSMUX, LOGL_DEBUG, - "building message (%p) into batch (%d)\n", cur, ++i); - rtph = osmo_rtp_get_hdr(cur); if (rtph == NULL) return NULL; - if (last_rtp_ssrc_set) - add_osmux_hdr = (last_rtp_ssrc == rtph->ssrc); + if (last_rtp_ssrc_set) { + add_osmux_hdr = (last_rtp_ssrc != rtph->ssrc); + if (add_osmux_hdr) + LOGP(DOSMUX, LOGL_DEBUG, "add osmux header\n"); + } + + LOGP(DOSMUX, LOGL_DEBUG, + "building message (%p) into batch (%d) ssrc=%u\n", + cur, ++i, rtph->ssrc); osmux_xfrm_encode_amr(batch_msg, rtph, cur, add_osmux_hdr); |