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

Unified Diff: content/browser/renderer_host/media/audio_input_renderer_host.cc

Issue 229573003: Adds more logging for audio input issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 | content/renderer/media/webrtc_audio_capturer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_input_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc
index ca5d0683d209a56a187430639fc1a85b811f2fd4..3e683fb61649d29909b7e0f51d0e962355754374 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
@@ -182,9 +182,20 @@ void AudioInputRendererHost::DoHandleError(
media::AudioInputController* controller,
media::AudioInputController::ErrorCode error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ // Log all errors even it is ignored later.
MediaStreamManager::SendMessageToNativeLog(
base::StringPrintf("AudioInputController error: %d", error_code));
+ // This is a fix for crbug.com/357501. The error can be triggered when closing
+ // the lid on Macs, which causes more problems than it fixes.
+ // Also, in crbug.com/357569, the goal is to remove usage of the error since
+ // it was added to solve a crash on Windows that no longer can be reproduced.
+ if (error_code == media::AudioInputController::NO_DATA_ERROR) {
+ DVLOG(1) << "AudioInputRendererHost@" << this << "::DoHandleError: "
+ << "NO_DATA_ERROR ignored.";
+ return;
+ }
+
AudioEntry* entry = LookupByController(controller);
if (!entry)
return;
@@ -237,6 +248,7 @@ void AudioInputRendererHost::OnCreateStream(
}
// Check if we have the permission to open the device and which device to use.
+ std::string device_name;
std::string device_id = media::AudioManagerBase::kDefaultDeviceId;
if (audio_params.format() != media::AudioParameters::AUDIO_FAKE) {
const StreamDeviceInfo* info = media_stream_manager_->
@@ -249,6 +261,7 @@ void AudioInputRendererHost::OnCreateStream(
}
device_id = info->device.id;
+ device_name = info->device.name;
}
// Create a new AudioEntry structure.
@@ -321,7 +334,7 @@ void AudioInputRendererHost::OnCreateStream(
audio_entries_.insert(std::make_pair(stream_id, entry.release()));
MediaStreamManager::SendMessageToNativeLog(
- "Audio input stream created successfully.");
+ "Audio input stream created successfully. Device name: " + device_name);
audio_log_->OnCreated(stream_id, audio_params, device_id);
}
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698