[Asterisk-cvs] asterisk rtp.c,1.92.2.13,1.92.2.14

russell at lists.digium.com russell at lists.digium.com
Tue May 31 08:52:26 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv19960

Modified Files:
      Tag: v1-0
	rtp.c 
Log Message:
correctly handle rtp padding (bug #4270)


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.92.2.13
retrieving revision 1.92.2.14
diff -u -d -r1.92.2.13 -r1.92.2.14
--- rtp.c	31 May 2005 02:24:16 -0000	1.92.2.13
+++ rtp.c	31 May 2005 12:55:43 -0000	1.92.2.14
@@ -407,6 +407,7 @@
 	int version;
 	int payloadtype;
 	int hdrlen = 12;
+	int padding;
 	int mark;
 	int ext;
 	char iabuf[INET_ADDRSTRLEN];
@@ -458,10 +459,17 @@
 		return &null_frame;
 	
 	payloadtype = (seqno & 0x7f0000) >> 16;
+	padding = seqno & (1 << 29);
 	mark = seqno & (1 << 23);
 	ext = seqno & (1 << 28);
 	seqno &= 0xffff;
 	timestamp = ntohl(rtpheader[1]);
+	
+	if (padding) {
+		/* Remove padding bytes */
+		res -= rtp->rawdata[AST_FRIENDLY_OFFSET + res - 1];
+	}
+	
 	if (ext) {
 		/* RTP Extension present */
 		hdrlen += 4;




More information about the svn-commits mailing list