Path: blob/main/audio/audacity/files/patch-src_AudioIO.cpp
16147 views
--- src/AudioIO.cpp.orig 2020-06-19 15:16:47 UTC1+++ src/AudioIO.cpp2@@ -490,7 +490,6 @@ time warp info and AudioIOListener and whether the pla3#define ROUND(x) (int) ((x)+0.5)4//#include <string.h>5// #include "../lib-src/portmidi/pm_common/portmidi.h"6- #include "../lib-src/portaudio-v19/src/common/pa_util.h"7#include "NoteTrack.h"8#endif910@@ -814,13 +813,22 @@ struct AudioIoCallback::ScrubState (private)11// return the system time as a double12static double streamStartTime = 0; // bias system time to small number1314+// PaUtil_GetTime is an internal PortAudio function. Unfortunately15+// it's used twice in AudioIO.cpp. It's a simple function so just16+// provide the implementation here.17+static double PaUtil_GetTime(void) {18+ struct timespec tp;19+ clock_gettime(CLOCK_REALTIME, &tp);20+ return (double)(tp.tv_sec + tp.tv_nsec * 1e-9);21+}22+23static double SystemTime(bool usingAlsa)24{25#ifdef __WXGTK__26if (usingAlsa) {27struct timespec now;28// CLOCK_MONOTONIC_RAW is unaffected by NTP or adj-time29- clock_gettime(CLOCK_MONOTONIC_RAW, &now);30+ clock_gettime(CLOCK_REALTIME, &now);31//return now.tv_sec + now.tv_nsec * 0.000000001;32return (now.tv_sec + now.tv_nsec * 0.000000001) - streamStartTime;33}343536