$OpenBSD: patch-src_AudioIO_cpp,v 1.11 2020/01/24 05:20:37 bket Exp $

- CLOCK_MONOTONIC_RAW is not portable
- PaUtil_GetTime is a private interface, not reachable when using system portaudio

Index: src/AudioIO.cpp
--- src/AudioIO.cpp.orig
+++ src/AudioIO.cpp
@@ -797,18 +797,15 @@ static double streamStartTime = 0; // bias system time
 static double SystemTime(bool usingAlsa)
 {
 #ifdef __WXGTK__
-   if (usingAlsa) {
+   (void)usingAlsa;
       struct timespec now;
       // CLOCK_MONOTONIC_RAW is unaffected by NTP or adj-time
-      clock_gettime(CLOCK_MONOTONIC_RAW, &now);
+      clock_gettime(CLOCK_MONOTONIC, &now);
       //return now.tv_sec + now.tv_nsec * 0.000000001;
       return (now.tv_sec + now.tv_nsec * 0.000000001) - streamStartTime;
-   }
 #else
    static_cast<void>(usingAlsa);//compiler food.
 #endif
-
-   return PaUtil_GetTime() - streamStartTime;
 }
 #endif
 
@@ -3606,7 +3603,7 @@ void AudioIoCallback::ComputeMidiTimings(
    }
 
    /* GSW: Save timeInfo in case MidiPlayback needs it */
-   mAudioCallbackClockTime = PaUtil_GetTime();
+   mAudioCallbackClockTime = SystemTime(mUsingAlsa);
 
    /* for Linux, estimate a smooth audio time as a slowly-changing
       offset from system time */
