summaryrefslogtreecommitdiffstats
path: root/media/audio
diff options
context:
space:
mode:
authordalecurtis <dalecurtis@chromium.org>2015-04-16 18:56:37 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-17 01:57:52 +0000
commit933778ccbfaa26fc859f43da2f98eba966082e34 (patch)
tree5f9aed2e1dd16a89683ae10be9204b51379ee4c0 /media/audio
parentf58961749a980032241fe6c3fc829ac2e6652030 (diff)
downloadchromium_src-933778ccbfaa26fc859f43da2f98eba966082e34.zip
chromium_src-933778ccbfaa26fc859f43da2f98eba966082e34.tar.gz
chromium_src-933778ccbfaa26fc859f43da2f98eba966082e34.tar.bz2
Partial revert of disabling low latency audio for remote desktop.
Crash and playback startup success rates remained the same before and after this change, so reverting the additional complexity. I've left the cleanup of internal functions though. BUG=422522 TEST=things work as before. Review URL: https://codereview.chromium.org/1091093002 Cr-Commit-Position: refs/heads/master@{#325577}
Diffstat (limited to 'media/audio')
-rw-r--r--media/audio/win/audio_low_latency_output_win.cc5
-rw-r--r--media/audio/win/core_audio_util_win.cc50
-rw-r--r--media/audio/win/core_audio_util_win.h3
3 files changed, 1 insertions, 57 deletions
diff --git a/media/audio/win/audio_low_latency_output_win.cc b/media/audio/win/audio_low_latency_output_win.cc
index 53b8a8d..f7b31a3 100644
--- a/media/audio/win/audio_low_latency_output_win.cc
+++ b/media/audio/win/audio_low_latency_output_win.cc
@@ -135,11 +135,6 @@ bool WASAPIAudioOutputStream::Open() {
DCHECK(!audio_client_.get());
DCHECK(!audio_render_client_.get());
- // Don't allow WASAPI streams to be created for remote output devices, this
- // frequently leads to hangs of the audio thread. http://crbug.com/422522.
- if (CoreAudioUtil::IsRemoteOutputDevice(device_id_))
- return false;
-
// Will be set to true if we ended up opening the default communications
// device.
bool communications_device = false;
diff --git a/media/audio/win/core_audio_util_win.cc b/media/audio/win/core_audio_util_win.cc
index b3bc62f..53530df 100644
--- a/media/audio/win/core_audio_util_win.cc
+++ b/media/audio/win/core_audio_util_win.cc
@@ -187,24 +187,6 @@ static ScopedComPtr<IMMDeviceEnumerator> CreateDeviceEnumeratorInternal() {
return device_enumerator;
}
-static bool IsRemoteSession() {
- return !!GetSystemMetrics(SM_REMOTESESSION);
-}
-
-static bool IsRemoteDeviceInternal(IMMDevice* device) {
- DCHECK(IsRemoteSession());
-
- std::string device_name;
- HRESULT hr = GetDeviceFriendlyNameInternal(device, &device_name);
-
- // This method should only be called if IsRemoteSession() is true, so assume
- // we have a remote audio device if we can't tell.
- if (FAILED(hr))
- return true;
-
- return device_name == "Remote Audio";
-}
-
static bool IsSupportedInternal() {
// It is possible to force usage of WaveXxx APIs by using a command line flag.
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
@@ -241,26 +223,7 @@ static bool IsSupportedInternal() {
return false;
}
- // Don't use CoreAudio when a remote desktop session with remote audio is
- // present; several users report only WaveAudio working for them and crash
- // reports show hangs when calling into the OS for CoreAudio API calls. See
- // http://crbug.com/422522 and http://crbug.com/180591.
- //
- // Note: There's another check in WASAPIAudioOutputStream::Open() for the case
- // where a remote session is created after Chrome has been started. Graceful
- // fallback to WaveOut will occur in this case via AudioOutputResampler.
- if (!IsRemoteSession())
- return true;
-
- ScopedComPtr<IMMDevice> device;
- HRESULT hr = device_enumerator->GetDefaultAudioEndpoint(eRender, eConsole,
- device.Receive());
-
- // Assume remote audio playback if we can't tell.
- if (FAILED(hr))
- return false;
-
- return !IsRemoteDeviceInternal(device.get());
+ return true;
}
bool CoreAudioUtil::IsSupported() {
@@ -906,15 +869,4 @@ bool CoreAudioUtil::FillRenderEndpointBufferWithSilence(
AUDCLNT_BUFFERFLAGS_SILENT));
}
-bool CoreAudioUtil::IsRemoteOutputDevice(const std::string& device_id) {
- DCHECK(IsSupported());
- if (!IsRemoteSession())
- return false;
- ScopedComPtr<IMMDevice> device(device_id.empty()
- ? CreateDefaultDevice(eRender, eConsole)
- : CreateDevice(device_id));
- // Assume remote audio if we can't tell.
- return device ? IsRemoteDeviceInternal(device.get()) : true;
-}
-
} // namespace media
diff --git a/media/audio/win/core_audio_util_win.h b/media/audio/win/core_audio_util_win.h
index 75e90ce..4e93531 100644
--- a/media/audio/win/core_audio_util_win.h
+++ b/media/audio/win/core_audio_util_win.h
@@ -229,9 +229,6 @@ class MEDIA_EXPORT CoreAudioUtil {
static bool FillRenderEndpointBufferWithSilence(
IAudioClient* client, IAudioRenderClient* render_client);
- // Returns true if the given output device is a remote audio endpoint.
- static bool IsRemoteOutputDevice(const std::string& device_id);
-
private:
CoreAudioUtil() {}
~CoreAudioUtil() {}