Ignore stale audio device errors when switching to a new device.
On Windows 10 transient errors for the disconnected device occur
with messages like "The operation completed successfully." We
should ignore these errors since we're going to destroy the device
and spin up a new one anyways.
This also fixes a minor issue where devices which encounter errors
might have been selected for reuse.
BUG=543909
TEST=plugin/unplug headset, observe non-fatal error.
Review URL: https://codereview.chromium.org/1417893004
Cr-Commit-Position: refs/heads/master@{#356459}
diff --git a/media/audio/audio_output_dispatcher_impl.h b/media/audio/audio_output_dispatcher_impl.h
index ab290c5..a2782f0 100644
--- a/media/audio/audio_output_dispatcher_impl.h
+++ b/media/audio/audio_output_dispatcher_impl.h
@@ -63,6 +63,9 @@
// Returns true if there are any open AudioOutputProxy objects.
bool HasOutputProxies() const;
+ // Closes all |idle_streams_|.
+ void CloseAllIdleStreams();
+
private:
friend class base::RefCountedThreadSafe<AudioOutputDispatcherImpl>;
~AudioOutputDispatcherImpl() override;
@@ -72,8 +75,6 @@
// opened.
bool CreateAndOpenStream();
- // Closes all |idle_streams_|.
- void CloseAllIdleStreams();
// Similar to CloseAllIdleStreams(), but keeps |keep_alive| streams alive.
void CloseIdleStreams(size_t keep_alive);