diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-10-03 18:32:59 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-10-03 18:32:59 +0000 |
commit | c3b1d8f8c18809b8fbab37bad1ebdccbe49b951d (patch) | |
tree | 39959bfca7fc78ed276ae3e2098b1992e0a14b86 | |
parent | 3578bc30fd22cd5a904cefce56c471066b39cd9d (diff) |
res_rtp_multicast: Ensure SSRC is set properly
This fixes a bug where the SSRC field on multicast RTP can be stuck at
0 which can cause problems for endpoints trying to make sense of
incoming streams.
(closes issue ASTERISK-22567)
Reported by: Simone Camporeale
Patches:
22567_res_mulitcast_ssrc.patch uploaded by Simone Camporeale (License 6536)
........
Merged revisions 400393 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 400394 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 400395 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | res/res_rtp_multicast.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/res/res_rtp_multicast.c b/res/res_rtp_multicast.c index 2b6678d11..c13e9ad1e 100644 --- a/res/res_rtp_multicast.c +++ b/res/res_rtp_multicast.c @@ -260,15 +260,15 @@ static int multicast_rtp_write(struct ast_rtp_instance *instance, struct ast_fra /* Construct an RTP header for our packet */ rtpheader = (unsigned char *)(f->data.ptr - hdrlen); put_unaligned_uint32(rtpheader, htonl((2 << 30) | (codec << 16) | (multicast->seqno))); - put_unaligned_uint32(rtpheader + 4, htonl(multicast->lastts)); if (ast_test_flag(f, AST_FRFLAG_HAS_TIMING_INFO)) { put_unaligned_uint32(rtpheader + 4, htonl(f->ts * 8)); - } - else { - put_unaligned_uint32(rtpheader + 8, htonl(multicast->ssrc)); + } else { + put_unaligned_uint32(rtpheader + 4, htonl(multicast->lastts)); } + put_unaligned_uint32(rtpheader + 8, htonl(multicast->ssrc)); + /* Increment sequence number and wrap to 0 if it overflows 16 bits. */ multicast->seqno = 0xFFFF & (multicast->seqno + 1); |