Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: webrtc/modules/audio_device/dummy/file_audio_device.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_device/dummy/file_audio_device.cc
diff --git a/webrtc/modules/audio_device/dummy/file_audio_device.cc b/webrtc/modules/audio_device/dummy/file_audio_device.cc
index d59eae2ae87bb84466bbf7e55073f9016f78dbaa..3fff40b0f9c03de391277151453f5832f29777fa 100644
--- a/webrtc/modules/audio_device/dummy/file_audio_device.cc
+++ b/webrtc/modules/audio_device/dummy/file_audio_device.cc
@@ -213,17 +213,10 @@ int32_t FileAudioDevice::StartPlayout() {
return -1;
}
- const char* threadName = "webrtc_audio_module_play_thread";
- _ptrThreadPlay =
- PlatformThread::CreateThread(PlayThreadFunc, this, threadName);
- if (!_ptrThreadPlay->Start()) {
- _ptrThreadPlay.reset();
- _playing = false;
- delete [] _playoutBuffer;
- _playoutBuffer = NULL;
- return -1;
- }
- _ptrThreadPlay->SetPriority(kRealtimePriority);
+ _ptrThreadPlay.reset(new rtc::PlatformThread(
+ PlayThreadFunc, this, "webrtc_audio_module_play_thread"));
+ _ptrThreadPlay->Start();
+ _ptrThreadPlay->SetPriority(rtc::kRealtimePriority);
return 0;
}
@@ -276,17 +269,11 @@ int32_t FileAudioDevice::StartRecording() {
return -1;
}
- const char* threadName = "webrtc_audio_module_capture_thread";
- _ptrThreadRec = PlatformThread::CreateThread(RecThreadFunc, this, threadName);
+ _ptrThreadRec.reset(new rtc::PlatformThread(
+ RecThreadFunc, this, "webrtc_audio_module_capture_thread"));
- if (!_ptrThreadRec->Start()) {
- _ptrThreadRec.reset();
- _recording = false;
- delete [] _recordingBuffer;
- _recordingBuffer = NULL;
- return -1;
- }
- _ptrThreadRec->SetPriority(kRealtimePriority);
+ _ptrThreadRec->Start();
+ _ptrThreadRec->SetPriority(rtc::kRealtimePriority);
return 0;
}
« no previous file with comments | « webrtc/modules/audio_device/dummy/file_audio_device.h ('k') | webrtc/modules/audio_device/linux/audio_device_alsa_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698