[Asterisk-cvs] asterisk rtp.c,1.63,1.64

markster at lists.digium.com markster at lists.digium.com
Sat May 1 11:11:04 CDT 2004


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

Modified Files:
	rtp.c 
Log Message:
Add DTX support (mark bit) (bug #1234)


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- rtp.c	20 Apr 2004 19:23:08 -0000	1.63
+++ rtp.c	1 May 2004 15:18:28 -0000	1.64
@@ -366,9 +366,9 @@
 	return &null_frame;
 }
 
-static void calc_rxstamp(struct timeval *tv, struct ast_rtp *rtp, unsigned int timestamp)
+static void calc_rxstamp(struct timeval *tv, struct ast_rtp *rtp, unsigned int timestamp, int mark)
 {
-	if (!rtp->rxcore.tv_sec && !rtp->rxcore.tv_usec) {
+	if ((!rtp->rxcore.tv_sec && !rtp->rxcore.tv_usec) || mark) {
 		gettimeofday(&rtp->rxcore, NULL);
 		rtp->rxcore.tv_sec -= timestamp / 8000;
 		rtp->rxcore.tv_usec -= (timestamp % 8000) * 125;
@@ -530,7 +530,7 @@
 			ast_log(LOG_NOTICE, "Unable to calculate samples for format %s\n", ast_getformatname(rtp->f.subclass));
 			break;
 		}
-		calc_rxstamp(&rtp->f.delivery, rtp, timestamp);
+		calc_rxstamp(&rtp->f.delivery, rtp, timestamp, mark);
 	} else {
 		/* Video -- samples is # of samples vs. 90000 */
 		if (!rtp->lastividtimestamp)
@@ -1026,8 +1026,10 @@
 			   and if so, go with our prediction */
 			if (abs(rtp->lastts - pred) < 640)
 				rtp->lastts = pred;
-			else
+			else {
 				ast_log(LOG_DEBUG, "Difference is %d, ms is %d\n", abs(rtp->lastts - pred), ms);
+				mark = 1;
+			}
 		}
 	} else {
 		mark = f->subclass & 0x1;




More information about the svn-commits mailing list