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

Unified Diff: services/media/audio/platform/linux/alsa_output.cc

Issue 1509323002: Mojom updates for Motown. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sync with master Created 5 years 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: services/media/audio/platform/linux/alsa_output.cc
diff --git a/services/media/audio/platform/linux/alsa_output.cc b/services/media/audio/platform/linux/alsa_output.cc
index fb5195508c2b693adb861ee42aa892eab186fe99..fd0c58a9c2c93467d94bf8a5e92ca0a31b7138d9 100644
--- a/services/media/audio/platform/linux/alsa_output.cc
+++ b/services/media/audio/platform/linux/alsa_output.cc
@@ -49,7 +49,7 @@ AudioOutputPtr CreateDefaultAlsaOutput(AudioOutputManager* manager) {
LpcmMediaTypeDetailsPtr config(LpcmMediaTypeDetails::New());
config->frames_per_second = 48000;
- config->samples_per_frame = 2;
+ config->channels = 2;
config->sample_format = LpcmSampleFormat::SIGNED_16;
if (alsa_out->Configure(config.Pass()) != MediaResult::OK) {
@@ -101,7 +101,7 @@ MediaResult AlsaOutput::Configure(LpcmMediaTypeDetailsPtr config) {
return MediaResult::UNSUPPORTED_CONFIG;
}
- if (SUPPORTED_CHANNEL_COUNTS.find(config->samples_per_frame) ==
+ if (SUPPORTED_CHANNEL_COUNTS.find(config->channels) ==
SUPPORTED_CHANNEL_COUNTS.end()) {
return MediaResult::UNSUPPORTED_CONFIG;
}
@@ -116,7 +116,7 @@ MediaResult AlsaOutput::Configure(LpcmMediaTypeDetailsPtr config) {
DCHECK(is_precise);
// Figure out how many bytes there are per frame.
- output_bytes_per_frame_ = bytes_per_sample * config->samples_per_frame;
+ output_bytes_per_frame_ = bytes_per_sample * config->channels;
// Success
output_format_ = config.Pass();
@@ -142,7 +142,7 @@ MediaResult AlsaOutput::Init() {
res = snd_pcm_set_params(alsa_device_,
alsa_format_,
SND_PCM_ACCESS_RW_INTERLEAVED,
- output_format_->samples_per_frame,
+ output_format_->channels,
output_format_->frames_per_second,
0, // do not allow ALSA resample
local_time::to_usec<unsigned int>(TARGET_LATENCY));
@@ -150,7 +150,7 @@ MediaResult AlsaOutput::Init() {
LOG(ERROR) << "Failed to configure ALSA device \"" << kAlsaDevice << "\" "
<< "(res = " << res << ")";
LOG(ERROR) << "Requested samples per frame: "
- << output_format_->samples_per_frame;
+ << output_format_->channels;
LOG(ERROR) << "Requested frames per second: "
<< output_format_->frames_per_second;
LOG(ERROR) << "Requested ALSA format : " << alsa_format_;
@@ -397,4 +397,3 @@ void AlsaOutput::HandleAlsaError(snd_pcm_sframes_t code) {
} // namespace audio
} // namespace media
} // namespace mojo
-

Powered by Google App Engine
This is Rietveld 408576698