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

Unified Diff: media/formats/webm/webm_audio_client.cc

Issue 2752323002: Support Opus Ambisonics playback (Closed)
Patch Set: another fix for unreliable ffmpeg channels vs layout Created 3 years, 7 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 | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/renderers/audio_renderer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_audio_client.cc
diff --git a/media/formats/webm/webm_audio_client.cc b/media/formats/webm/webm_audio_client.cc
index d6eda2f3af6d29c6ba163a06a451847ff2a437c6..0cf3492346d8461dca040220fb45aa3484dc2eab 100644
--- a/media/formats/webm/webm_audio_client.cc
+++ b/media/formats/webm/webm_audio_client.cc
@@ -50,7 +50,14 @@ bool WebMAudioClient::InitializeConfig(
if (channels_ == -1)
channels_ = 1;
- ChannelLayout channel_layout = GuessChannelLayout(channels_);
+ bool is_opus_discrete = false;
+ if (audio_codec == kCodecOpus && codec_private.size() >= 19) {
+ int mapping_family = codec_private[18];
+ is_opus_discrete = mapping_family == 2;
+ }
+ ChannelLayout channel_layout = is_opus_discrete && channels_ > 8
+ ? CHANNEL_LAYOUT_DISCRETE
+ : GuessChannelLayout(channels_);
if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) {
MEDIA_LOG(ERROR, media_log_) << "Unsupported channel count " << channels_;
@@ -82,6 +89,7 @@ bool WebMAudioClient::InitializeConfig(
base::TimeDelta::FromMicroseconds(
(seek_preroll != -1 ? seek_preroll : 0) / 1000),
codec_delay_in_frames);
+ config->SetChannelsForDiscrete(channels_);
return config->IsValidConfig();
}
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/renderers/audio_renderer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698