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

Unified Diff: webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc

Issue 2103863004: UMA log for audio_device Init and Start(Playout|Recording). Make Init return a more specific error … (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix more silly errors. Created 4 years, 6 months 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/linux/audio_device_alsa_linux.cc
diff --git a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
index bdbccde05012ec35cd71048008e5a0182216fa57..279900654f64264e0ab8764bfb53c7b5f0bdee16 100644
--- a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
@@ -155,25 +155,21 @@ int32_t AudioDeviceLinuxALSA::ActiveAudioLayer(
return 0;
}
-int32_t AudioDeviceLinuxALSA::Init()
-{
-
- CriticalSectionScoped lock(&_critSect);
+AudioDeviceGeneric::InitStatus AudioDeviceLinuxALSA::Init() {
+ CriticalSectionScoped lock(&_critSect);
- // Load libasound
- if (!AlsaSymbolTable.Load())
- {
- // Alsa is not installed on
- // this system
- WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
- " failed to load symbol table");
- return -1;
- }
+ // Load libasound
+ if (!AlsaSymbolTable.Load()) {
+ // Alsa is not installed on
+ // this system
+ WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
+ " failed to load symbol table");
+ return InitStatus::kOtherError;
+ }
- if (_initialized)
- {
- return 0;
- }
+ if (_initialized) {
+ return InitStatus::kOk;
+ }
#if defined(USE_X11)
//Get X display handle for typing detection
_XDisplay = XOpenDisplay(NULL);
@@ -190,7 +186,7 @@ int32_t AudioDeviceLinuxALSA::Init()
_initialized = true;
- return 0;
+ return InitStatus::kOk;
}
int32_t AudioDeviceLinuxALSA::Terminate()

Powered by Google App Engine
This is Rietveld 408576698