diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-11 09:05:22 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-11 09:05:22 +0000 |
commit | e5b1fc3be246be1b285ea9c3f0933a76717684d7 (patch) | |
tree | 31a2432ace9fe85f5da226faa389f84e69ab7684 /rtp.c | |
parent | bb1705d6b39bdd76108f7006810f006a4ab831b1 (diff) |
backport fix from trunk for bug #6934, ensuring that RTP mark bit is changed when SSRC changes
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@26773 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rw-r--r-- | rtp.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -90,6 +90,7 @@ struct ast_rtp { unsigned char rawdata[8192 + AST_FRIENDLY_OFFSET]; /*! Synchronization source, RFC 3550, page 10. */ unsigned int ssrc; + unsigned int rxssrc; unsigned int lastts; unsigned int lastdigitts; unsigned int lastrxts; @@ -436,6 +437,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; static struct ast_frame *f, null_frame = { AST_FRAME_NULL, }; @@ -492,6 +494,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 */ |