Index: webrtc/modules/audio_device/win/audio_device_core_win.cc |
diff --git a/webrtc/modules/audio_device/win/audio_device_core_win.cc b/webrtc/modules/audio_device/win/audio_device_core_win.cc |
index 811a04d2fef8971f6c3e888e12a4f4fe72c22ffc..0512fdb3f8c12005f20ba9a2dbec388ac0a273c1 100644 |
--- a/webrtc/modules/audio_device/win/audio_device_core_win.cc |
+++ b/webrtc/modules/audio_device/win/audio_device_core_win.cc |
@@ -333,7 +333,9 @@ bool AudioDeviceWindowsCore::CoreAudioIsSupported() |
int temp_ok(0); |
bool available(false); |
- ok |= p->Init(); |
+ if (p->Init() != InitStatus::kOk) { |
+ ok |= -1; |
+ } |
int16_t numDevsRec = p->RecordingDevices(); |
for (uint16_t i = 0; i < numDevsRec; i++) |
@@ -675,31 +677,28 @@ int32_t AudioDeviceWindowsCore::ActiveAudioLayer(AudioDeviceModule::AudioLayer& |
// Init |
// ---------------------------------------------------------------------------- |
-int32_t AudioDeviceWindowsCore::Init() |
-{ |
- |
- CriticalSectionScoped lock(&_critSect); |
+AudioDeviceGeneric::InitStatus AudioDeviceWindowsCore::Init() { |
+ CriticalSectionScoped lock(&_critSect); |
- if (_initialized) |
- { |
- return 0; |
- } |
+ if (_initialized) { |
+ return InitStatus::kOk; |
+ } |
- _playWarning = 0; |
- _playError = 0; |
- _recWarning = 0; |
- _recError = 0; |
+ _playWarning = 0; |
+ _playError = 0; |
+ _recWarning = 0; |
+ _recError = 0; |
- // Enumerate all audio rendering and capturing endpoint devices. |
- // Note that, some of these will not be able to select by the user. |
- // The complete collection is for internal use only. |
- // |
- _EnumerateEndpointDevicesAll(eRender); |
- _EnumerateEndpointDevicesAll(eCapture); |
+ // Enumerate all audio rendering and capturing endpoint devices. |
+ // Note that, some of these will not be able to select by the user. |
+ // The complete collection is for internal use only. |
+ // |
+ _EnumerateEndpointDevicesAll(eRender); |
+ _EnumerateEndpointDevicesAll(eCapture); |
- _initialized = true; |
+ _initialized = true; |
- return 0; |
+ return InitStatus::kOk; |
} |
// ---------------------------------------------------------------------------- |