mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-27 06:07:59 +02:00
Remove my USE_TIME_INFO conditional compilation... will fix otherwise
This commit is contained in:
parent
857a7ca737
commit
b38bacfafa
@ -1554,9 +1554,6 @@ bool AudioIO::StartPortAudioStream(double sampleRate,
|
|||||||
int userData = 24;
|
int userData = 24;
|
||||||
int* lpUserData = (captureFormat_saved == int24Sample) ? &userData : NULL;
|
int* lpUserData = (captureFormat_saved == int24Sample) ? &userData : NULL;
|
||||||
|
|
||||||
#ifndef USE_TIME_INFO
|
|
||||||
mMidiTimeCorrection = 0;
|
|
||||||
#endif
|
|
||||||
mLastPaError = Pa_OpenStream( &mPortStreamV19,
|
mLastPaError = Pa_OpenStream( &mPortStreamV19,
|
||||||
useCapture ? &captureParameters : NULL,
|
useCapture ? &captureParameters : NULL,
|
||||||
usePlayback ? &playbackParameters : NULL,
|
usePlayback ? &playbackParameters : NULL,
|
||||||
@ -1571,13 +1568,6 @@ bool AudioIO::StartPortAudioStream(double sampleRate,
|
|||||||
#endif
|
#endif
|
||||||
if (mPortStreamV19 != NULL && mLastPaError == paNoError) {
|
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__
|
#ifdef __WXMAC__
|
||||||
if (mPortMixer) {
|
if (mPortMixer) {
|
||||||
if (Px_SupportsPlaythrough(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
|
// have the virtue of keeping the Midi output synched with audio, even though
|
||||||
// pmlinuxalsa.c does not implement any synchronization of its own.
|
// pmlinuxalsa.c does not implement any synchronization of its own.
|
||||||
|
|
||||||
#ifdef USE_TIME_INFO
|
|
||||||
auto offset = mAudioCallbackOutputDacTime - mAudioCallbackOutputCurrentTime;
|
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 clockChange = PaUtil_GetTime() - mAudioCallbackClockTime;
|
||||||
// auto offset = mAudioCallbackOutputDacTime - mAudioCallbackOutputCurrentTime;
|
// auto offset = mAudioCallbackOutputDacTime - mAudioCallbackOutputCurrentTime;
|
||||||
@ -4147,7 +4128,7 @@ PmTimestamp AudioIO::MidiTime()
|
|||||||
AudioTime() + 1.0005 -
|
AudioTime() + 1.0005 -
|
||||||
mAudioFramesPerBuffer / mRate +
|
mAudioFramesPerBuffer / mRate +
|
||||||
clockChange - offset
|
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 */
|
/* GSW: Save timeInfo in case MidiPlayback needs it */
|
||||||
gAudioIO->mAudioCallbackClockTime = PaUtil_GetTime();
|
gAudioIO->mAudioCallbackClockTime = PaUtil_GetTime();
|
||||||
|
|
||||||
#ifdef USE_TIME_INFO
|
|
||||||
gAudioIO->mAudioCallbackOutputDacTime = timeInfo->outputBufferDacTime;
|
gAudioIO->mAudioCallbackOutputDacTime = timeInfo->outputBufferDacTime;
|
||||||
gAudioIO->mAudioCallbackOutputCurrentTime = timeInfo->currentTime;
|
gAudioIO->mAudioCallbackOutputCurrentTime = timeInfo->currentTime;
|
||||||
#endif
|
|
||||||
|
|
||||||
// printf("in callback, mAudioCallbackOutputDacTime %g\n", gAudioIO->mAudioCallbackOutputDacTime); //DBG
|
// printf("in callback, mAudioCallbackOutputDacTime %g\n", gAudioIO->mAudioCallbackOutputDacTime); //DBG
|
||||||
gAudioIO->mAudioFramesPerBuffer = framesPerBuffer;
|
gAudioIO->mAudioFramesPerBuffer = framesPerBuffer;
|
||||||
|
@ -99,13 +99,6 @@ DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_AUDIOIO_MONITOR, -1);
|
|||||||
// play. PRL.
|
// play. PRL.
|
||||||
#undef USE_MIDI_THREAD
|
#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;
|
struct ScrubbingOptions;
|
||||||
|
|
||||||
// To avoid growing the argument list of StartStream, add fields here
|
// To avoid growing the argument list of StartStream, add fields here
|
||||||
@ -542,10 +535,6 @@ private:
|
|||||||
PmStream *mMidiStream;
|
PmStream *mMidiStream;
|
||||||
PmError mLastPmError;
|
PmError mLastPmError;
|
||||||
|
|
||||||
#ifndef USE_TIME_INFO
|
|
||||||
PaTime mMidiTimeCorrection; // seconds
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Latency of MIDI synthesizer
|
/// Latency of MIDI synthesizer
|
||||||
long mSynthLatency; // ms
|
long mSynthLatency; // ms
|
||||||
|
|
||||||
@ -554,12 +543,11 @@ private:
|
|||||||
/// PortAudio's clock time
|
/// PortAudio's clock time
|
||||||
volatile double mAudioCallbackClockTime;
|
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!
|
/// PortAudio's currentTime -- its origin is unspecified!
|
||||||
volatile double mAudioCallbackOutputCurrentTime;
|
volatile double mAudioCallbackOutputCurrentTime;
|
||||||
/// PortAudio's outTime
|
/// PortAudio's outTime
|
||||||
volatile double mAudioCallbackOutputDacTime;
|
volatile double mAudioCallbackOutputDacTime;
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Number of frames output, including pauses
|
/// Number of frames output, including pauses
|
||||||
volatile long mNumFrames;
|
volatile long mNumFrames;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user