[Summary] In internal Waves backend API, switching sample time from 32 bits to 64...
authorVKamyshniy <VKamyshniy@wavesglobal.com>
Fri, 20 Feb 2015 10:52:47 +0000 (12:52 +0200)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 20 Feb 2015 18:03:09 +0000 (13:03 -0500)
libs/backends/wavesaudio/waves_audiobackend.cc
libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h
libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h
libs/backends/wavesaudio/wavesapi/devicemanager/WCMRNativeAudio.cpp
libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h

index 0b42b3bce767738c967299d99271fc3e1dc2ea83..922190c34b1bf20f0c87ead096ccfb83600df320 100644 (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,
index 3ec108b38078f678bcb34535f14652a79d6b63e9..db0104a25d9ab51d1ac043212fba29340bfdba99 100644 (file)
@@ -126,7 +126,7 @@ class WCMRAudioDeviceManagerClient
         const float *acdInputBuffer;
         float *acdOutputBuffer;
         size_t acdFrames;
-        uint32_t acdSampleTime;
+        uint64_t acdSampleTime;
         uint64_t acdCycleStartTimeNanos;
     };
 
index 74d1d18dfd6afbc9eecc5dd10292f535b335f806..c74895ed7c0c3a7b3567711ae3d394c1eb487823 100644 (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.
 
index b05a2dfc6eaf3a81daf5b16a4d782f8bf7cd2328..7bea0b3f04b1404080fead32fa780ddf408e0708 100644 (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;
                
index 2202c4fed55cc025b7f6e3a6edcf34af1623113a..a93d2d745a6c2da7bf04780f88bd98030f81ac79 100644 (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.