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

Unified Diff: media/audio/win/audio_low_latency_output_win.cc

Issue 1314803003: Include default communication devices in audio device enumerations. This removes heuristic that pic… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment Created 5 years, 4 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 | « media/audio/win/audio_low_latency_input_win.cc ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/audio_low_latency_output_win.cc
diff --git a/media/audio/win/audio_low_latency_output_win.cc b/media/audio/win/audio_low_latency_output_win.cc
index 494d1b1f9fe3579271df1baf83c5844da5168a83..c297acc6d54c87c0c6c5e8bf0184484d09fe4c69 100644
--- a/media/audio/win/audio_low_latency_output_win.cc
+++ b/media/audio/win/audio_low_latency_output_win.cc
@@ -72,6 +72,12 @@ WASAPIAudioOutputStream::WASAPIAudioOutputStream(AudioManagerWin* manager,
audio_bus_(AudioBus::Create(params)) {
DCHECK(manager_);
+ // The empty string is used to indicate a default device and the
+ // |device_role_| member controls whether that's the default or default
+ // communications device.
+ DCHECK_NE(device_id_, AudioManagerBase::kDefaultDeviceId);
+ DCHECK_NE(device_id_, AudioManagerBase::kCommunicationsDeviceId);
+
DVLOG(1) << "WASAPIAudioOutputStream::WASAPIAudioOutputStream()";
DVLOG_IF(1, share_mode_ == AUDCLNT_SHAREMODE_EXCLUSIVE)
<< "Core Audio (WASAPI) EXCLUSIVE MODE is enabled.";
@@ -140,8 +146,7 @@ bool WASAPIAudioOutputStream::Open() {
// Create an IAudioClient interface for the default rendering IMMDevice.
ScopedComPtr<IAudioClient> audio_client;
- if (device_id_.empty() ||
- CoreAudioUtil::DeviceIsDefault(eRender, device_role_, device_id_)) {
+ if (device_id_.empty()) {
audio_client = CoreAudioUtil::CreateDefaultClient(eRender, device_role_);
communications_device = (device_role_ == eCommunications);
} else {
« no previous file with comments | « media/audio/win/audio_low_latency_input_win.cc ('k') | media/audio/win/audio_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698