diff options
author | Mark Spencer <markster@digium.com> | 2006-05-11 08:47:37 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2006-05-11 08:47:37 +0000 |
commit | dda130c334e15f62ac5a5601f51059a7a9dfd2f3 (patch) | |
tree | ef5ed799f82f1d235710438065e50fbfc1a2b0b3 /rtp.c | |
parent | c16bf2c7dda8f620c21107994606af77e284dad4 (diff) |
Set "MARK" whenever SSRC changes (bug #6934)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'rtp.c')
-rw-r--r-- | rtp.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -93,6 +93,7 @@ struct ast_rtp { struct ast_frame f; unsigned char rawdata[8192 + AST_FRIENDLY_OFFSET]; unsigned int ssrc; /*!< Synchronization source, RFC 3550, page 10. */ + unsigned int rxssrc; unsigned int lastts; unsigned int lastdigitts; unsigned int lastrxts; @@ -430,6 +431,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) int ext; int x; char iabuf[INET_ADDRSTRLEN]; + unsigned int ssrc; unsigned int timestamp; unsigned int *rtpheader; struct rtpPayloadType rtpPT; @@ -485,6 +487,14 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) ext = seqno & (1 << 28); seqno &= 0xffff; timestamp = ntohl(rtpheader[1]); + ssrc = ntohl(rtpheader[2]); + + if (!mark && rtp->rxssrc && rtp->rxssrc != ssrc) { + ast_log(LOG_WARNING, "Forcing Marker bit, because SSRC has changed\n"); + mark = 1; + } + + rtp->rxssrc = ssrc; if (padding) { /* Remove padding bytes */ |