diff options
Diffstat (limited to 'webrtc/modules/audio_device/win/audio_device_wave_win.cc')
-rw-r--r-- | webrtc/modules/audio_device/win/audio_device_wave_win.cc | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/webrtc/modules/audio_device/win/audio_device_wave_win.cc b/webrtc/modules/audio_device/win/audio_device_wave_win.cc index 96bee7425a..6f4d7df397 100644 --- a/webrtc/modules/audio_device/win/audio_device_wave_win.cc +++ b/webrtc/modules/audio_device/win/audio_device_wave_win.cc @@ -228,15 +228,9 @@ int32_t AudioDeviceWindowsWave::Init() } const char* threadName = "webrtc_audio_module_thread"; - _ptrThread = ThreadWrapper::CreateThread(ThreadFunc, this, threadName); - if (!_ptrThread->Start()) - { - WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, - "failed to start the audio thread"); - _ptrThread.reset(); - return -1; - } - _ptrThread->SetPriority(kRealtimePriority); + _ptrThread.reset(new rtc::PlatformThread(ThreadFunc, this, threadName)); + _ptrThread->Start(); + _ptrThread->SetPriority(rtc::kRealtimePriority); const bool periodic(true); if (!_timeEvent.StartTimer(periodic, TIMER_PERIOD_MS)) @@ -250,12 +244,8 @@ int32_t AudioDeviceWindowsWave::Init() WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "periodic timer (dT=%d) is now active", TIMER_PERIOD_MS); - _hGetCaptureVolumeThread = CreateThread(NULL, - 0, - GetCaptureVolumeThread, - this, - 0, - NULL); + _hGetCaptureVolumeThread = + CreateThread(NULL, 0, GetCaptureVolumeThread, this, 0, NULL); if (_hGetCaptureVolumeThread == NULL) { WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, @@ -265,12 +255,8 @@ int32_t AudioDeviceWindowsWave::Init() SetThreadPriority(_hGetCaptureVolumeThread, THREAD_PRIORITY_NORMAL); - _hSetCaptureVolumeThread = CreateThread(NULL, - 0, - SetCaptureVolumeThread, - this, - 0, - NULL); + _hSetCaptureVolumeThread = + CreateThread(NULL, 0, SetCaptureVolumeThread, this, 0, NULL); if (_hSetCaptureVolumeThread == NULL) { WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, @@ -303,7 +289,7 @@ int32_t AudioDeviceWindowsWave::Terminate() if (_ptrThread) { - ThreadWrapper* tmpThread = _ptrThread.release(); + rtc::PlatformThread* tmpThread = _ptrThread.release(); _critSect.Leave(); _timeEvent.Set(); |