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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user