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

Unified Diff: webrtc/modules/audio_device/win/audio_mixer_manager_win.cc

Issue 1269563002: Added protection for GetCapabilities() failure. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/win/audio_mixer_manager_win.cc
diff --git a/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc b/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc
index 4d6e7bb9a694206ecb9e5b77bf044e42ed33b39e..79076d39a70f2e49f0c8817b49531a03cfcbe15d 100644
--- a/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc
+++ b/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc
@@ -195,7 +195,9 @@ int32_t AudioMixerManager::EnumerateSpeakers()
for (mixId = 0; mixId < nDevices; mixId++)
{
// get capabilities for the specified mixer ID
- GetCapabilities(mixId, caps);
+ if (!GetCapabilities(mixId, caps))
+ continue;
+
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "[mixerID=%d] %s: ", mixId, WideToUTF8(caps.szPname));
// scan all avaliable destinations for this mixer
for (destId = 0; destId < caps.cDestinations; destId++)
@@ -280,7 +282,9 @@ int32_t AudioMixerManager::EnumerateMicrophones()
for (mixId = 0; mixId < nDevices; mixId++)
{
// get capabilities for the specified mixer ID
- GetCapabilities(mixId, caps);
+ if (!GetCapabilities(mixId, caps))
+ continue;
+
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "[mixerID=%d] %s: ", mixId, WideToUTF8(caps.szPname));
// scan all avaliable destinations for this mixer
for (destId = 0; destId < caps.cDestinations; destId++)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698