[Asterisk-cvs] asterisk/channels chan_iax2.c,1.188.2.10,1.188.2.11

russell at lists.digium.com russell at lists.digium.com
Tue Jan 4 11:13:11 CST 2005


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

Modified Files:
      Tag: v1-0
	chan_iax2.c 
Log Message:
I got a crash in iax that I think is related to this timestamp patch, so I am going to back it out until we get it figured out. (bug #3119)


Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.188.2.10
retrieving revision 1.188.2.11
diff -u -d -r1.188.2.10 -r1.188.2.11
--- chan_iax2.c	30 Dec 2004 19:07:08 -0000	1.188.2.10
+++ chan_iax2.c	4 Jan 2005 17:18:15 -0000	1.188.2.11
@@ -2815,18 +2815,6 @@
 	return ms + ts;
 }
 
-static void add_ms(struct timeval *tv, int ms) {
-  tv->tv_usec += ms * 1000;
-  if(tv->tv_usec > 1000000) {
-      tv->tv_usec -= 1000000;
-      tv->tv_sec++;
-  }
-  if(tv->tv_usec < 0) {
-      tv->tv_usec += 1000000;
-      tv->tv_sec--;
-  }
-}
-
 static unsigned int calc_timestamp(struct chan_iax2_pvt *p, unsigned int ts, struct ast_frame *f)
 {
 	struct timeval tv;
@@ -2847,8 +2835,6 @@
 			delivery = &f->delivery;
 		} else if (f->frametype == AST_FRAME_IAX) {
 			genuine = 1;
-		} else if (f->frametype == AST_FRAME_CNG) {
-			p->notsilenttx = 0;	
 		}
 	}
 	if (!p->offset.tv_sec && !p->offset.tv_usec) {
@@ -2873,33 +2859,15 @@
 			ms = 0;
 		if (voice) {
 			/* On a voice frame, use predicted values if appropriate */
-			if (p->notsilenttx && abs(ms - p->nextpred) <= MAX_TIMESTAMP_SKEW) {
-				/* Adjust our txcore, keeping voice and 
-					non-voice synchronized */
-				add_ms(&p->offset, (int)(ms - p->nextpred)/10);
-
+			if (abs(ms - p->nextpred) <= MAX_TIMESTAMP_SKEW) {
 				if (!p->nextpred) {
 					p->nextpred = ms; /*f->samples / 8;*/
 					if (p->nextpred <= p->lastsent)
 						p->nextpred = p->lastsent + 3;
 				}
 				ms = p->nextpred;
-			} else {
-			       /* in this case, just use the actual
-				* time, since we're either way off
-				* (shouldn't happen), or we're  ending a
-				* silent period -- and seed the next
-				* predicted time.  Also, round ms to the
-				* next multiple of frame size (so our
-				* silent periods are multiples of
-				* frame size too) */
-				int diff = ms % (f->samples / 8);
-				if(diff)
-				    ms += f->samples/8 - diff;
-
+			} else
 				p->nextpred = ms;
-				p->notsilenttx = 1;
-			}
 		} else {
 			/* On a dataframe, use last value + 3 (to accomodate jitter buffer shrinking) if appropriate unless
 			   it's a genuine frame */




More information about the svn-commits mailing list