mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
backport fix from trunk for bug #6934, ensuring that RTP mark bit is changed when SSRC changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@26773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
10
rtp.c
10
rtp.c
@@ -90,6 +90,7 @@ struct ast_rtp {
|
|||||||
unsigned char rawdata[8192 + AST_FRIENDLY_OFFSET];
|
unsigned char rawdata[8192 + AST_FRIENDLY_OFFSET];
|
||||||
/*! Synchronization source, RFC 3550, page 10. */
|
/*! Synchronization source, RFC 3550, page 10. */
|
||||||
unsigned int ssrc;
|
unsigned int ssrc;
|
||||||
|
unsigned int rxssrc;
|
||||||
unsigned int lastts;
|
unsigned int lastts;
|
||||||
unsigned int lastdigitts;
|
unsigned int lastdigitts;
|
||||||
unsigned int lastrxts;
|
unsigned int lastrxts;
|
||||||
@@ -436,6 +437,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
|
|||||||
int ext;
|
int ext;
|
||||||
int x;
|
int x;
|
||||||
char iabuf[INET_ADDRSTRLEN];
|
char iabuf[INET_ADDRSTRLEN];
|
||||||
|
unsigned int ssrc;
|
||||||
unsigned int timestamp;
|
unsigned int timestamp;
|
||||||
unsigned int *rtpheader;
|
unsigned int *rtpheader;
|
||||||
static struct ast_frame *f, null_frame = { AST_FRAME_NULL, };
|
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);
|
ext = seqno & (1 << 28);
|
||||||
seqno &= 0xffff;
|
seqno &= 0xffff;
|
||||||
timestamp = ntohl(rtpheader[1]);
|
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) {
|
if (padding) {
|
||||||
/* Remove padding bytes */
|
/* Remove padding bytes */
|
||||||
|
|||||||
Reference in New Issue
Block a user