Index: webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc |
diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc |
index 42c3ea82954ebb04eeac0ff9e2b17e5aa2ce37c4..2ca8bcdfa3e76997760706655b685645f3da546a 100644 |
--- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc |
+++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc |
@@ -163,58 +163,51 @@ int32_t AudioDeviceLinuxPulse::ActiveAudioLayer( |
return 0; |
} |
-int32_t AudioDeviceLinuxPulse::Init() |
-{ |
- RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
- if (_initialized) |
- { |
- return 0; |
- } |
- |
- // Initialize PulseAudio |
- if (InitPulseAudio() < 0) |
- { |
- WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, |
- " failed to initialize PulseAudio"); |
- |
- if (TerminatePulseAudio() < 0) |
- { |
- WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, |
- " failed to terminate PulseAudio"); |
- } |
- |
- return -1; |
+AudioDeviceGeneric::InitStatus AudioDeviceLinuxPulse::Init() { |
+ RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
+ if (_initialized) { |
+ return InitStatus::kOk; |
+ } |
+ |
+ // Initialize PulseAudio |
+ if (InitPulseAudio() < 0) { |
+ WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, |
henrika_webrtc
2016/06/30 08:44:20
Could you fix these as well. I.e., don't use WEBRT
Max Morin WebRTC
2016/06/30 10:56:04
Done.
|
+ " failed to initialize PulseAudio"); |
+ if (TerminatePulseAudio() < 0) { |
+ WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, |
+ " failed to terminate PulseAudio"); |
} |
+ return InitStatus::kOtherError; |
+ } |
- _playWarning = 0; |
- _playError = 0; |
- _recWarning = 0; |
- _recError = 0; |
+ _playWarning = 0; |
+ _playError = 0; |
+ _recWarning = 0; |
+ _recError = 0; |
- //Get X display handle for typing detection |
- _XDisplay = XOpenDisplay(NULL); |
- if (!_XDisplay) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
- " failed to open X display, typing detection will not work"); |
- } |
+ // Get X display handle for typing detection |
+ _XDisplay = XOpenDisplay(NULL); |
+ if (!_XDisplay) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ " failed to open X display, typing detection will not work"); |
+ } |
- // RECORDING |
- _ptrThreadRec.reset(new rtc::PlatformThread( |
- RecThreadFunc, this, "webrtc_audio_module_rec_thread")); |
+ // RECORDING |
+ _ptrThreadRec.reset(new rtc::PlatformThread( |
+ RecThreadFunc, this, "webrtc_audio_module_rec_thread")); |
- _ptrThreadRec->Start(); |
- _ptrThreadRec->SetPriority(rtc::kRealtimePriority); |
+ _ptrThreadRec->Start(); |
+ _ptrThreadRec->SetPriority(rtc::kRealtimePriority); |
- // PLAYOUT |
- _ptrThreadPlay.reset(new rtc::PlatformThread( |
- PlayThreadFunc, this, "webrtc_audio_module_play_thread")); |
- _ptrThreadPlay->Start(); |
- _ptrThreadPlay->SetPriority(rtc::kRealtimePriority); |
+ // PLAYOUT |
+ _ptrThreadPlay.reset(new rtc::PlatformThread( |
+ PlayThreadFunc, this, "webrtc_audio_module_play_thread")); |
+ _ptrThreadPlay->Start(); |
+ _ptrThreadPlay->SetPriority(rtc::kRealtimePriority); |
- _initialized = true; |
+ _initialized = true; |
- return 0; |
+ return InitStatus::kOk; |
} |
int32_t AudioDeviceLinuxPulse::Terminate() |