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

Unified Diff: media/base/audio_decoder_config.cc

Issue 2752323002: Support Opus Ambisonics playback (Closed)
Patch Set: Fix issues from rebase 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
Index: media/base/audio_decoder_config.cc
diff --git a/media/base/audio_decoder_config.cc b/media/base/audio_decoder_config.cc
index 225f19a7f796c34c42c31e2dfcf78dd11f8181d5..0022dae0940ae9c5cb62b9ad0cd79d52fc2425d6 100644
--- a/media/base/audio_decoder_config.cc
+++ b/media/base/audio_decoder_config.cc
@@ -51,8 +51,10 @@ void AudioDecoderConfig::Initialize(AudioCodec codec,
seek_preroll_ = seek_preroll;
codec_delay_ = codec_delay;
- int channels = ChannelLayoutToChannelCount(channel_layout_);
- bytes_per_frame_ = channels * bytes_per_channel_;
+ // If |channel_layout_| is CHANNEL_LAYOUT_DISCRETE, |channels_| and
+ // |bytes_per_frame_| will be overwritten in SetChannelsForDiscrete()
+ channels_ = ChannelLayoutToChannelCount(channel_layout_);
+ bytes_per_frame_ = channels_ * bytes_per_channel_;
}
AudioDecoderConfig::~AudioDecoderConfig() {}
@@ -86,6 +88,7 @@ std::string AudioDecoderConfig::AsHumanReadableString() const {
s << "codec: " << GetCodecName(codec())
<< " bytes_per_channel: " << bytes_per_channel()
<< " channel_layout: " << channel_layout()
+ << " channels: " << channels()
<< " samples_per_second: " << samples_per_second()
<< " sample_format: " << sample_format()
<< " bytes_per_frame: " << bytes_per_frame()

Powered by Google App Engine
This is Rietveld 408576698