systemclock: Don't divide by zero on Windows if high performance timers are not available
authorSebastian Dröge <sebastian@centricular.com>
Mon, 9 Mar 2020 13:16:00 +0000 (15:16 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 9 Mar 2020 13:16:00 +0000 (15:16 +0200)
gst/gstsystemclock.c

index adfc117..e80f3ef 100644 (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__