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

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

Issue 2968673002: Making AudioInputDeviceManager to return UnavailableDeviceParameters when there are no physical inp… (Closed)
Patch Set: Created 3 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_input_device_manager.cc
diff --git a/content/browser/renderer_host/media/audio_input_device_manager.cc b/content/browser/renderer_host/media/audio_input_device_manager.cc
index caa83202370ea4727c7c51c11373deda97fc58f5..df53b4fb7bc449ce706024c1ace2124fc6312d1f 100644
--- a/content/browser/renderer_host/media/audio_input_device_manager.cc
+++ b/content/browser/renderer_host/media/audio_input_device_manager.cc
@@ -171,13 +171,18 @@ void AudioInputDeviceManager::OpenedOnIOThread(
UMA_HISTOGRAM_TIMES("Media.AudioInputDeviceManager.OpenOnDeviceThreadTime",
base::TimeTicks::Now() - start_time);
+ media::AudioParameters valid_input_params =
+ input_params.IsValid()
+ ? input_params
+ : media::AudioParameters::UnavailableDeviceParams();
+
StreamDeviceInfo info(device.type, device.name, device.id);
info.session_id = session_id;
- info.device.input.sample_rate = input_params.sample_rate();
- info.device.input.channel_layout = input_params.channel_layout();
- info.device.input.frames_per_buffer = input_params.frames_per_buffer();
- info.device.input.effects = input_params.effects();
- info.device.input.mic_positions = input_params.mic_positions();
+ info.device.input.sample_rate = valid_input_params.sample_rate();
+ info.device.input.channel_layout = valid_input_params.channel_layout();
+ info.device.input.frames_per_buffer = valid_input_params.frames_per_buffer();
+ info.device.input.effects = valid_input_params.effects();
+ info.device.input.mic_positions = valid_input_params.mic_positions();
info.device.matched_output_device_id = matched_output_device_id;
info.device.matched_output.sample_rate = matched_output_params.sample_rate();
info.device.matched_output.channel_layout =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698