systemclock: Don't divide by zero on Windows if high performance timers are not available

This commit is contained in:
Sebastian Dröge 2020-03-09 15:16:00 +02:00
parent 5edc20188a
commit daf7df28dd

View file

@ -193,10 +193,11 @@ gst_system_clock_init (GstSystemClock * clock)
#ifdef G_OS_WIN32
QueryPerformanceFrequency (&priv->frequency);
/* can be 0 if the hardware does not have hardware support */
if (priv->frequency.QuadPart != 0)
if (priv->frequency.QuadPart != 0) {
/* we take a base time so that time starts from 0 to ease debugging */
QueryPerformanceCounter (&priv->start);
priv->ratio = GST_SECOND / priv->frequency.QuadPart;
priv->ratio = GST_SECOND / priv->frequency.QuadPart;
}
#endif /* G_OS_WIN32 */
#ifdef __APPLE__