[asterisk-commits] twilson: branch 1.6.1 r200171 - /branches/1.6.1/main/rtp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 11 16:25:24 CDT 2009


Author: twilson
Date: Thu Jun 11 16:25:14 2009
New Revision: 200171

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=200171
Log:
Don't access rtp->rtpc->* if rtp->rtpc is null

Modified:
    branches/1.6.1/main/rtp.c

Modified: branches/1.6.1/main/rtp.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/main/rtp.c?view=diff&rev=200171&r1=200170&r2=200171
==============================================================================
--- branches/1.6.1/main/rtp.c (original)
+++ branches/1.6.1/main/rtp.c Thu Jun 11 16:25:14 2009
@@ -1494,18 +1494,21 @@
 	if (d<0)
 		d=-d;
 	rtp->rxjitter += (1./16.) * (d - rtp->rxjitter);
-	if (rtp->rtcp && rtp->rxjitter > rtp->rtcp->maxrxjitter)
-		rtp->rtcp->maxrxjitter = rtp->rxjitter;
-	if (rtp->rtcp->rxjitter_count == 1) 
-		rtp->rtcp->minrxjitter = rtp->rxjitter;
-	if (rtp->rtcp && rtp->rxjitter < rtp->rtcp->minrxjitter)
-		rtp->rtcp->minrxjitter = rtp->rxjitter;
-		
-	normdev_rxjitter_current = normdev_compute(rtp->rtcp->normdev_rxjitter,rtp->rxjitter,rtp->rtcp->rxjitter_count);
-	rtp->rtcp->stdev_rxjitter = stddev_compute(rtp->rtcp->stdev_rxjitter,rtp->rxjitter,rtp->rtcp->normdev_rxjitter,normdev_rxjitter_current,rtp->rtcp->rxjitter_count);
-
-	rtp->rtcp->normdev_rxjitter = normdev_rxjitter_current;
-	rtp->rtcp->rxjitter_count++;
+
+	if (rtp->rtcp) {
+		if (rtp->rxjitter > rtp->rtcp->maxrxjitter)
+			rtp->rtcp->maxrxjitter = rtp->rxjitter;
+		if (rtp->rtcp->rxjitter_count == 1) 
+			rtp->rtcp->minrxjitter = rtp->rxjitter;
+		if (rtp->rxjitter < rtp->rtcp->minrxjitter)
+			rtp->rtcp->minrxjitter = rtp->rxjitter;
+			
+		normdev_rxjitter_current = normdev_compute(rtp->rtcp->normdev_rxjitter,rtp->rxjitter,rtp->rtcp->rxjitter_count);
+		rtp->rtcp->stdev_rxjitter = stddev_compute(rtp->rtcp->stdev_rxjitter,rtp->rxjitter,rtp->rtcp->normdev_rxjitter,normdev_rxjitter_current,rtp->rtcp->rxjitter_count);
+
+		rtp->rtcp->normdev_rxjitter = normdev_rxjitter_current;
+		rtp->rtcp->rxjitter_count++;
+	}
 }
 
 /*! \brief Perform a Packet2Packet RTP write */




More information about the asterisk-commits mailing list