#endif
#include "WCMRNativeAudio.h"
-#include "MiscUtils/pthread_utils.h"
#include "MiscUtils/safe_delete.h"
#include <iostream>
#include <sstream>
//**********************************************************************************************
WCMRNativeAudioNoneDevice::WCMRNativeAudioNoneDevice (WCMRAudioDeviceManager *pManager)
: WCMRNativeAudioDevice (pManager, false /*useMultiThreading*/)
+ , m_SilenceThread(0)
#if defined (PLATFORM_WINDOWS)
, _waitableTimerForUsleep (CreateWaitableTimer(NULL, TRUE, NULL))
#endif
{
- mark_pthread_inactive (m_SilenceThread);
-
m_DeviceName = NONE_DEVICE_NAME;
m_SamplingRates = boost::assign::list_of (m_CurrentSamplingRate=44100)(48000)(88200)(96000);
if (Streaming())
{
- if (is_pthread_active (m_SilenceThread))
+ if (m_SilenceThread)
std::cerr << "\t\t\t\t\t !!!!!!!!!!!!!!! Warning: the inactive NONE-DEVICE was streaming!" << std::endl;
pthread_attr_t attributes;
}
if (pthread_create (&m_SilenceThread, &attributes, __SilenceThread, this)) {
- mark_pthread_inactive (m_SilenceThread);
+ m_SilenceThread = 0;
std::cerr << "WCMRNativeAudioNoneDevice::SetStreaming (): pthread_create () failed!" << std::endl;
return eGenericErr;
}
}
else
{
- if (!is_pthread_active (m_SilenceThread))
+ if (!m_SilenceThread)
{
std::cerr << "\t\t\t\t\t !!!!!!!!!!!!!!! Warning: the active NONE-DEVICE was NOT streaming!" << std::endl;
}
- while (is_pthread_active (m_SilenceThread))
+ while (m_SilenceThread)
{
_usleep(1); //now wait for ended thread;
}
}
audioCallbackData.acdCycleStartTimeNanos = cycleEndTimeNanos+1;
}
- mark_pthread_inactive (m_SilenceThread);
+ m_SilenceThread = 0;
}
void* WCMRNativeAudioNoneDevice::__SilenceThread(void *This)