libobs/util: Cache windows CPU frequency

Caches the frequency of the performance counter.  It was supposed to be
caching it already, but it seems that code was unintentionally not
included.

Closes jp9000/obs-studio#1185
This commit is contained in:
JetMeta 2018-02-06 22:50:28 +08:00 committed by jp9000
parent ef7a64228f
commit 18c1f10488

View file

@ -37,8 +37,11 @@ static uint32_t winver = 0;
static inline uint64_t get_clockfreq(void)
{
if (!have_clockfreq)
if (!have_clockfreq) {
QueryPerformanceFrequency(&clock_freq);
have_clockfreq = true;
}
return clock_freq.QuadPart;
}