[Summary] Fixed issue when Audio Callback thread is changed

[Reviewed by] PDavis, VKamyshniy
This commit is contained in:
GZharun 2015-02-11 19:45:10 +02:00
parent ffccd23f08
commit 8da1ad9fcf
4 changed files with 24 additions and 11 deletions

View file

@ -944,6 +944,9 @@ void WCMRPortAudioDevice::startStreaming (bool callerIsWaiting/*=false*/)
unsigned int inChannelCount = pDeviceInfo->maxInputChannels;
unsigned int outChannelCount = pDeviceInfo->maxOutputChannels;
// Prepare for streaming - tell Engine to do the initialization for process callback
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::DeviceStartsStreaming);
paErr = Pa_StartStream( m_PortAudioStream );
if(paErr == paNoError)
@ -1088,8 +1091,7 @@ void WCMRPortAudioDevice::resetDevice (bool callerIsWaiting /*=false*/ )
// Resume streaming if the device was streaming before
if(wasStreaming && m_lastErr == eNoErr && m_ConnectionStatus == DeviceAvailable)
{
// Notify the Application to prepare for the stream start
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::DeviceStartsStreaming);
// start streaming
startStreaming();
}
} else {
@ -1342,7 +1344,6 @@ WTErr WCMRPortAudioDevice::ShowConfigPanel (void *pParam)
// restore previous state for the device
SetActive(true);
if (wasStreaming) {
m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::DeviceStartsStreaming);
SetStreaming(true);
}
}