[PATCH] arrival time in microseconds

"Rini van Zetten" <[email protected]> Wed, 9 Jan 2008 15:31:58 +0100
Newsgroups gmane.comp.gnu.ccrtp.devel
Message-ID <014f01c852cc$63f31460$2b00a8c0@ARV127>
Below is a patch which corrects the arrival time calculation in the 
recordReception function in incqueue.cpp.

The tarrival is in microseconds and the getCurrentRTPClockRate() returns a 
timestamp in units per second.

The result of this patch is an correct jitter value in the RR and SR 
reports.

please give comments about the patch.

Regards,
Rini van Zetten


------------------------------------------------------------------------------------------
--- incqueue.cpp 2007-09-26 15:54:01.000000000 +0200
+++ incqueue.cpp.new 2008-01-09 15:21:24.000000000 +0100
@@ -690,8 +690,8 @@ IncomingDataQueue::recordReception(SyncS
timeval lastT = srcLink.getLastPacketTime();
timeval initial = srcLink.getInitialDataTime();
timersub(&lastT,&initial,&tarrival);
- uint32 arrival = timeval2microtimeout(tarrival)
- * getCurrentRTPClockRate();
+ uint32 arrival = timeval2microtimeout(tarrival)
+ * getCurrentRTPClockRate() * 1e-6;
uint32 transitTime = arrival - pkt.getTimestamp();
int32 delta = transitTime -
srcLink.getLastPacketTransitTime();