mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-31 08:58:43 +01:00
Roger's timing correction for Alsa; I unified with non-Alsa case...
... Write only one variable in audacityAudioCallback, to be read (maybe in another thread) by AudioIO::MidiTime(). The non-Alsa case behaves essentially as before: it wasn't broken, so it isn't fixed, though it is rearranged.
This commit is contained in:
@@ -543,12 +543,6 @@ private:
|
||||
/// PortAudio's clock time
|
||||
volatile double mAudioCallbackClockTime;
|
||||
|
||||
/// Rely on these two only if not using the Alsa host api:
|
||||
/// PortAudio's currentTime -- its origin is unspecified!
|
||||
volatile double mAudioCallbackOutputCurrentTime;
|
||||
/// PortAudio's outTime
|
||||
volatile double mAudioCallbackOutputDacTime;
|
||||
|
||||
/// Number of frames output, including pauses
|
||||
volatile long mNumFrames;
|
||||
/// How many frames of zeros were output due to pauses?
|
||||
@@ -565,9 +559,27 @@ private:
|
||||
/// stream closing until last message has been delivered
|
||||
PmTimestamp mMaxMidiTimestamp;
|
||||
|
||||
/// Offset from ideal sample computation time to system time,
|
||||
/// where "ideal" means when we would get the callback if there
|
||||
/// were no scheduling delays or computation time
|
||||
double mSystemMinusAudioTime;
|
||||
/// audio output latency reported by PortAudio
|
||||
/// (initially; for Alsa, we adjust it to the largest "observed" value)
|
||||
double mAudioOutLatency;
|
||||
|
||||
// Next two are used to adjust the previous two, if
|
||||
// PortAudio does not provide the info (using ALSA):
|
||||
|
||||
/// time of first callback
|
||||
/// used to find "observed" latency
|
||||
double mStartTime;
|
||||
/// number of callbacks since stream start
|
||||
long mCallbackCount;
|
||||
|
||||
/// Make just one variable to communicate from audio to MIDI thread,
|
||||
/// to avoid problems of atomicity of updates
|
||||
volatile double mSystemMinusAudioTimePlusLatency;
|
||||
|
||||
Alg_seq_ptr mSeq;
|
||||
std::unique_ptr<Alg_iterator> mIterator;
|
||||
/// The next event to play (or null)
|
||||
@@ -782,4 +794,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user