]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_multicast: Ensure SSRC is set properly
authorKinsey Moore <kmoore@digium.com>
Thu, 3 Oct 2013 18:25:21 +0000 (18:25 +0000)
committerKinsey Moore <kmoore@digium.com>
Thu, 3 Oct 2013 18:25:21 +0000 (18:25 +0000)
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@400393 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_rtp_multicast.c

index 2b5cbbc82aaaac3e84d4e6ec24841a696d05fd5b..7793c5a3a4af4c4063e677189dfa5645a5828239 100644 (file)
@@ -261,14 +261,14 @@ 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 + 4, htonl(multicast->lastts));
        }
-       else {
-               put_unaligned_uint32(rtpheader + 8, htonl(multicast->ssrc));
-       }
+
+       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);