13
0

[Summary] In internal Waves backend API, switching sample time from 32 bits to 64 bits. Fixing logical inconsistency: None device always brought sample time=0 to the audio engine callback.

This commit is contained in:
VKamyshniy 2015-02-20 12:52:47 +02:00 committed by Paul Davis
parent 5d5f83c56b
commit 3b5da657af
5 changed files with 7 additions and 8 deletions

View File

@ -80,7 +80,7 @@ void WavesAudioBackend::AudioDeviceManagerNotification (NotificationReason reaso
break;
case WCMRAudioDeviceManagerClient::AudioCallback:
if (parameter) {
AudioCallbackData* audio_callback_data = (AudioCallbackData*)parameter;
const AudioCallbackData* audio_callback_data = (AudioCallbackData*)parameter;
_audio_device_callback (
audio_callback_data->acdInputBuffer,
audio_callback_data->acdOutputBuffer,

View File

@ -126,7 +126,7 @@ class WCMRAudioDeviceManagerClient
const float *acdInputBuffer;
float *acdOutputBuffer;
size_t acdFrames;
uint32_t acdSampleTime;
uint64_t acdSampleTime;
uint64_t acdCycleStartTimeNanos;
};

View File

@ -100,8 +100,8 @@ protected:
AudioDeviceID m_DeviceID; ///< The CoreAudio device id
bool m_StopRequested; ///< should be set to true when want to stop, set to false otherwise.
float *m_pInputData; ///< This is what came in with the most recent callback.
int m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
int m_SampleCountAtLastIdle; ///< What was the sample count last time we checked...
uint64_t m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
uint64_t m_SampleCountAtLastIdle; ///< What was the sample count last time we checked...
int m_StalledSampleCounter; ///< The number of idle calls with same sample count detected
int m_ChangeCheckCounter; ///< The number of idle calls passed since we checked the buffer size change.

View File

@ -193,7 +193,6 @@ void WCMRNativeAudioNoneDevice::_SilenceThread()
float* theInpBuffers = _m_inputBuffer;
#endif
uint32_t currentSampleTime = 0;
const size_t buffer_size = CurrentBufferSize();
const uint64_t cyclePeriodNanos = (1000000000.0 * buffer_size) / CurrentSamplingRate();
@ -215,7 +214,7 @@ void WCMRNativeAudioNoneDevice::_SilenceThread()
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::AudioCallback, (void *)&audioCallbackData);
currentSampleTime += buffer_size;
audioCallbackData.acdSampleTime += buffer_size;
int64_t timeToSleepUsecs = ((int64_t)cycleEndTimeNanos - (int64_t)__get_time_nanos())/1000;

View File

@ -96,8 +96,8 @@ protected:
PaStream* m_PortAudioStream; ///< Port audio stream, when the device is active!
bool m_StopRequested; ///< should be set to true when want to stop, set to false otherwise.
const float *m_pInputData; ///< This is what came in with the most recent callback.
int m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
int m_SampleCountAtLastIdle;
uint64_t m_SampleCounter; ///< The current running sample counter, updated by the audio callback.
uint64_t m_SampleCountAtLastIdle;
int m_DropsDetected; ///< Number of times audio drops have been detected so far.
int m_DropsReported; ///< Number of times audio drops have been reported so far to the client.