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

Remove my USE_TIME_INFO conditional compilation... will fix otherwise

This commit is contained in:
Paul Licameli 2017-09-23 23:40:25 -04:00
parent 857a7ca737
commit b38bacfafa
2 changed files with 2 additions and 35 deletions

View File

@ -1554,9 +1554,6 @@ bool AudioIO::StartPortAudioStream(double sampleRate,
int userData = 24;
int* lpUserData = (captureFormat_saved == int24Sample) ? &userData : NULL;
#ifndef USE_TIME_INFO
mMidiTimeCorrection = 0;
#endif
mLastPaError = Pa_OpenStream( &mPortStreamV19,
useCapture ? &captureParameters : NULL,
usePlayback ? &playbackParameters : NULL,
@ -1571,13 +1568,6 @@ bool AudioIO::StartPortAudioStream(double sampleRate,
#endif
if (mPortStreamV19 != NULL && mLastPaError == paNoError) {
#ifndef USE_TIME_INFO
auto info = Pa_GetStreamInfo(mPortStreamV19);
if (info)
mMidiTimeCorrection =
info->outputLatency - (MIDI_MINIMAL_LATENCY_MS / 1000.0);
#endif
#ifdef __WXMAC__
if (mPortMixer) {
if (Px_SupportsPlaythrough(mPortMixer)) {
@ -4130,16 +4120,7 @@ PmTimestamp AudioIO::MidiTime()
// have the virtue of keeping the Midi output synched with audio, even though
// pmlinuxalsa.c does not implement any synchronization of its own.
#ifdef USE_TIME_INFO
auto offset = mAudioCallbackOutputDacTime - mAudioCallbackOutputCurrentTime;
#else
// We are now using mMidiTimeCorrection, computed once after opening the
// portaudio stream, rather than the difference of dac and current
// times reported to the audio callback; because on Linux with ALSA,
// the dac and current times were not reliable, and that caused irregular
// timing of Midi playback because latency was effectively zero.
auto offset = mMidiTimeCorrection;
#endif
auto clockChange = PaUtil_GetTime() - mAudioCallbackClockTime;
// auto offset = mAudioCallbackOutputDacTime - mAudioCallbackOutputCurrentTime;
@ -4147,7 +4128,7 @@ PmTimestamp AudioIO::MidiTime()
AudioTime() + 1.0005 -
mAudioFramesPerBuffer / mRate +
clockChange - offset
)));
))) + MIDI_MINIMAL_LATENCY_MS;
}
@ -4418,10 +4399,8 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
/* GSW: Save timeInfo in case MidiPlayback needs it */
gAudioIO->mAudioCallbackClockTime = PaUtil_GetTime();
#ifdef USE_TIME_INFO
gAudioIO->mAudioCallbackOutputDacTime = timeInfo->outputBufferDacTime;
gAudioIO->mAudioCallbackOutputCurrentTime = timeInfo->currentTime;
#endif
// printf("in callback, mAudioCallbackOutputDacTime %g\n", gAudioIO->mAudioCallbackOutputDacTime); //DBG
gAudioIO->mAudioFramesPerBuffer = framesPerBuffer;

View File

@ -99,13 +99,6 @@ DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_AUDIOIO_MONITOR, -1);
// play. PRL.
#undef USE_MIDI_THREAD
// Whether we trust all of the time info passed to audacityAudioCallback
#ifdef __WXGTK__
#undef USE_TIME_INFO
#else
#define USE_TIME_INFO
#endif
struct ScrubbingOptions;
// To avoid growing the argument list of StartStream, add fields here
@ -542,10 +535,6 @@ private:
PmStream *mMidiStream;
PmError mLastPmError;
#ifndef USE_TIME_INFO
PaTime mMidiTimeCorrection; // seconds
#endif
/// Latency of MIDI synthesizer
long mSynthLatency; // ms
@ -554,12 +543,11 @@ private:
/// PortAudio's clock time
volatile double mAudioCallbackClockTime;
#ifdef USE_TIME_INFO
/// 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;
#endif
/// Number of frames output, including pauses
volatile long mNumFrames;