1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Bug1714, more: better calculation of MidiTime...

... after I reflected more on the explanation of it in the long comment at top.

Brings back the use of PaUtil_GetTime() but now calls it also in the audio IO
callback, so we can correct the unspecified origin of times supplied to the
audio IO callback to agree with the PaUtilGetTime() clock.

Thus the Midi time calculation is again based on the clock time of the other
thread that calls MidiTime, making it a few milliseconds more accurate, while
avoiding subtraction of two times based on widely different origins, which
made the big numbers that overlowed and caused Bug1714 to happen.
This commit is contained in:
Paul Licameli
2017-08-14 01:20:37 -04:00
parent 76a9962a5e
commit 47eaf526a6
2 changed files with 21 additions and 4 deletions

View File

@@ -530,7 +530,10 @@ private:
// These fields are used to synchronize MIDI with audio:
/// PortAudio's currentTime
/// PortAudio's clock time
volatile double mAudioCallbackClockTime;
/// PortAudio's currentTime -- its origin is unspecified! So that's why
/// we also record the above
volatile double mAudioCallbackOutputCurrentTime;
/// PortAudio's outTime
volatile double mAudioCallbackOutputDacTime;