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

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

Issue 459363003: MediaStreamTrack.getSources list is now updated when input devices is disabled on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: media/audio/win/audio_device_listener_win.cc
diff --git a/media/audio/win/audio_device_listener_win.cc b/media/audio/win/audio_device_listener_win.cc
index d7e017cbd0311272a53bfb3c4480d9e27aabff52..b2727e6797b33ece6be847ff42c6b080a9476835 100644
--- a/media/audio/win/audio_device_listener_win.cc
+++ b/media/audio/win/audio_device_listener_win.cc
@@ -125,8 +125,19 @@ STDMETHODIMP AudioDeviceListenerWin::OnDeviceRemoved(LPCWSTR device_id) {
STDMETHODIMP AudioDeviceListenerWin::OnDeviceStateChanged(LPCWSTR device_id,
DWORD new_state) {
- if (new_state != DEVICE_STATE_ACTIVE && new_state != DEVICE_STATE_NOTPRESENT)
- return S_OK;
+ std::string new_state_str("UNDEFINED");
xians 2014/08/12 11:59:09 Have you verified that you only get one event when
henrika (OOO until Aug 14) 2014/08/12 12:04:39 I do get two callbacks but with the same new_state
+ if (new_state == DEVICE_STATE_ACTIVE)
+ new_state_str = "DEVICE_STATE_ACTIVE";
+ else if (new_state == DEVICE_STATE_DISABLED)
+ new_state_str = "DEVICE_STATE_DISABLED";
+ else if (new_state == DEVICE_STATE_NOTPRESENT)
+ new_state_str = "DEVICE_STATE_NOTPRESENT";
+ else if (new_state == DEVICE_STATE_UNPLUGGED)
+ new_state_str = "DEVICE_STATE_UNPLUGGED";
+
+ DVLOG(1) << "AudioDeviceListenerWin::OnDeviceStateChanged () "
xians 2014/08/12 11:59:09 I am not sure if this logging adds any value after
henrika (OOO until Aug 14) 2014/08/12 12:04:39 It would have done this debugging more easy if it
+ << "device_id: " << device_id
+ << ", new_state: " << new_state_str;
base::SystemMonitor* monitor = base::SystemMonitor::Get();
if (monitor)

Powered by Google App Engine
This is Rietveld 408576698