[Live-devel] minor bug on windows implementation of gettimeofday()

Patrick White patbob at imoveinc.com
Wed Apr 1 11:16:59 PDT 2009


Over in GroupSockHelper.cpp is a windows implementation of gettimeofday().  
There are three implementations for it -- one for CE (?), one that uses 
ftime() and another that uses QueryPerformanceCounter().

The version that uses QueryPerformanceCounter() is broken.  With that 
implementation, the epoch of the returned times is variant -- seemns to be 
last-boot.  gettimeofday() is supposed to return wall clock times with an 
invariant epoch.  The ftime() implementation should be used on windows 
instead, which one gets by compiling the library with the 
USE_OLD_GETTIMEOFDAY_FOR_WINDOWS_CODE symbol defined.

I think I found the only place where it matters -- gettimeofday() is used to 
record the time of the last received RTCP RR report.  In all other places, it 
seems to be used for delta times against other calls to gettimeofday(), so 
either implementation is OK for them.

You should probably remove or fix that QueryPerformanceCounter() variant so 
gettimeofday() does what it is supposed to do -- we all have the library 
source so you never know when one of us is going to try to print out the time 
of the last RR report or something :)


More information about the live-devel mailing list