From: Lars Op den Kamp Date: Wed, 21 Mar 2012 15:17:30 +0000 (+0100) Subject: cec: fixed - frequency wasn't checked in GetTimeMs(), leading to incorrect wait times... X-Git-Tag: upstream/2.2.0~1^2~31^2~60 X-Git-Url: https://git.piment-noir.org/?p=deb_libcec.git;a=commitdiff_plain;h=3127f60885e5b76be2265048bf9a6eff79c284f1 cec: fixed - frequency wasn't checked in GetTimeMs(), leading to incorrect wait times on some windows systems --- diff --git a/src/lib/platform/util/timeutils.h b/src/lib/platform/util/timeutils.h index f4f2810..5f2d27a 100644 --- a/src/lib/platform/util/timeutils.h +++ b/src/lib/platform/util/timeutils.h @@ -80,15 +80,12 @@ namespace PLATFORM #if defined(__APPLE__) return (int64_t) (CVGetCurrentHostTime() / (int64_t)(CVGetHostClockFrequency() * 0.001)); #elif defined(__WINDOWS__) - time_t rawtime; - time(&rawtime); - LARGE_INTEGER tickPerSecond; LARGE_INTEGER tick; if (QueryPerformanceFrequency(&tickPerSecond)) { QueryPerformanceCounter(&tick); - return (int64_t) (tick.QuadPart / 1000.); + return (int64_t) (tick.QuadPart / (tickPerSecond.QuadPart / 1000.)); } return -1; #else