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

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

Issue 2948233002: Making AudioInputDeviceManager to return UnavailableDeviceParameters when there are no physical inp… (Closed)
Patch Set: nit fix 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 75f91ee928756beaa63140ef3abe2132add32c5c..876e1138d5d36f2fc3c60eaf6210acb397217c4f 100644
--- a/content/browser/renderer_host/media/audio_input_device_manager.cc
+++ b/content/browser/renderer_host/media/audio_input_device_manager.cc
@@ -168,13 +168,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