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

Unified Diff: content/renderer/media/audio_renderer_mixer_manager.cc

Issue 2752323002: Support Opus Ambisonics playback (Closed)
Patch Set: If WebAudio is not used and the input channel layout is discrete, default to the hardware layout Created 3 years, 9 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
Index: content/renderer/media/audio_renderer_mixer_manager.cc
diff --git a/content/renderer/media/audio_renderer_mixer_manager.cc b/content/renderer/media/audio_renderer_mixer_manager.cc
index f22bdc3f6d7c94d38cff3ee3f6ac4e05466c47ac..03b5fe86820095cda9a96fcbf29f813243d0fa49 100644
--- a/content/renderer/media/audio_renderer_mixer_manager.cc
+++ b/content/renderer/media/audio_renderer_mixer_manager.cc
@@ -70,10 +70,17 @@ media::AudioParameters GetMixerOutputParams(
DCHECK_NE(output_buffer_size, 0);
+ // If the input has discrete channel layout, the hardware channel mapping is
DaleCurtis 2017/03/29 22:46:55 Is this necessary here? I would have thought the b
flim-chromium 2017/03/30 19:35:10 Without this check, I get the browser failing with
DaleCurtis 2017/03/30 20:22:21 What's crashing?
flim-chromium 2017/03/31 00:12:14 The stack trace is: [1:12:0330/163613.993344:FATA
DaleCurtis 2017/03/31 19:06:53 Seem like AudioConverter needs to be taught how to
flim-chromium 2017/04/05 18:19:34 As discussed offline, I've removed this and added
+ // unknown. Default to the hardware channel layout instead. Any input
+ // channels beyond the hardware channel count will not be played out.
+ media::ChannelLayout channel_layout =
+ input_params.channel_layout() == media::CHANNEL_LAYOUT_DISCRETE
+ ? hardware_params.channel_layout()
+ : input_params.channel_layout();
+
// Force to 16-bit output for now since we know that works everywhere;
// ChromeOS does not support other bit depths.
- media::AudioParameters params(input_params.format(),
- input_params.channel_layout(),
+ media::AudioParameters params(input_params.format(), channel_layout,
output_sample_rate, 16, output_buffer_size);
// Specify the latency info to be passed to the browser side.
« no previous file with comments | « no previous file | content/renderer/media/audio_renderer_mixer_manager_unittest.cc » ('j') | media/ffmpeg/ffmpeg_common.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698