summaryrefslogtreecommitdiffstats
path: root/media/audio/audio_parameters.cc
diff options
context:
space:
mode:
Diffstat (limited to 'media/audio/audio_parameters.cc')
-rw-r--r--media/audio/audio_parameters.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc
index dfe2d07..029f831 100644
--- a/media/audio/audio_parameters.cc
+++ b/media/audio/audio_parameters.cc
@@ -8,28 +8,31 @@
AudioParameters::AudioParameters()
: format(AUDIO_PCM_LINEAR),
- channels(0),
+ channel_layout(CHANNEL_LAYOUT_NONE),
sample_rate(0),
bits_per_sample(0),
- samples_per_packet(0) {
+ samples_per_packet(0),
+ channels(0) {
}
AudioParameters::AudioParameters(const media::AudioDecoderConfig& config)
: format(AUDIO_PCM_LINEAR),
- channels(config.channels_per_sample),
+ channel_layout(config.channel_layout),
sample_rate(config.sample_rate),
bits_per_sample(config.bits_per_channel),
- samples_per_packet(0) {
+ samples_per_packet(0),
+ channels(ChannelLayoutToChannelCount(config.channel_layout)) {
}
-AudioParameters::AudioParameters(Format format, int channels,
+AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout,
int sample_rate, int bits_per_sample,
int samples_per_packet)
: format(format),
- channels(channels),
+ channel_layout(channel_layout),
sample_rate(sample_rate),
bits_per_sample(bits_per_sample),
- samples_per_packet(samples_per_packet) {
+ samples_per_packet(samples_per_packet),
+ channels(ChannelLayoutToChannelCount(channel_layout)) {
}
bool AudioParameters::IsValid() const {