summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorwtc <wtc@chromium.org>2014-12-17 17:44:37 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-18 01:44:58 +0000
commit710f98e7955b60a97f8775ebf0248be2a1dc2a05 (patch)
tree0f3c281193178f4ca4d5efc9d2c84436c6cecf76 /media
parentc4e291151f6cebe0f1c981a3cb16cac4db25a93d (diff)
downloadchromium_src-710f98e7955b60a97f8775ebf0248be2a1dc2a05.zip
chromium_src-710f98e7955b60a97f8775ebf0248be2a1dc2a05.tar.gz
chromium_src-710f98e7955b60a97f8775ebf0248be2a1dc2a05.tar.bz2
Change "comsumes" to "consumes".
Remove an "else" after a return statement. R=dalecurtis@chromium.org BUG=none Review URL: https://codereview.chromium.org/807923004 Cr-Commit-Position: refs/heads/master@{#308916}
Diffstat (limited to 'media')
-rw-r--r--media/audio/alsa/alsa_output.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/media/audio/alsa/alsa_output.cc b/media/audio/alsa/alsa_output.cc
index 1fbab14..9e124d2 100644
--- a/media/audio/alsa/alsa_output.cc
+++ b/media/audio/alsa/alsa_output.cc
@@ -215,25 +215,25 @@ bool AlsaPcmOutputStream::Open() {
stop_stream_ = true;
TransitionTo(kInError);
return false;
+ }
+ bytes_per_output_frame_ =
+ channel_mixer_ ? mixed_audio_bus_->channels() * bytes_per_sample_
+ : bytes_per_frame_;
+ uint32 output_packet_size = frames_per_packet_ * bytes_per_output_frame_;
+ buffer_.reset(new media::SeekableBuffer(0, output_packet_size));
+
+ // Get alsa buffer size.
+ snd_pcm_uframes_t buffer_size;
+ snd_pcm_uframes_t period_size;
+ int error =
+ wrapper_->PcmGetParams(playback_handle_, &buffer_size, &period_size);
+ if (error < 0) {
+ LOG(ERROR) << "Failed to get playback buffer size from ALSA: "
+ << wrapper_->StrError(error);
+ // Buffer size is at least twice of packet size.
+ alsa_buffer_frames_ = frames_per_packet_ * 2;
} else {
- bytes_per_output_frame_ = channel_mixer_ ?
- mixed_audio_bus_->channels() * bytes_per_sample_ : bytes_per_frame_;
- uint32 output_packet_size = frames_per_packet_ * bytes_per_output_frame_;
- buffer_.reset(new media::SeekableBuffer(0, output_packet_size));
-
- // Get alsa buffer size.
- snd_pcm_uframes_t buffer_size;
- snd_pcm_uframes_t period_size;
- int error = wrapper_->PcmGetParams(playback_handle_, &buffer_size,
- &period_size);
- if (error < 0) {
- LOG(ERROR) << "Failed to get playback buffer size from ALSA: "
- << wrapper_->StrError(error);
- // Buffer size is at least twice of packet size.
- alsa_buffer_frames_ = frames_per_packet_ * 2;
- } else {
- alsa_buffer_frames_ = buffer_size;
- }
+ alsa_buffer_frames_ = buffer_size;
}
return true;
@@ -351,7 +351,7 @@ void AlsaPcmOutputStream::BufferPacket(bool* source_exhausted) {
*source_exhausted = false;
// Request more data only when we run out of data in the buffer, because
- // WritePacket() comsumes only the current chunk of data.
+ // WritePacket() consumes only the current chunk of data.
if (!buffer_->forward_bytes()) {
// Before making a request to source for data we need to determine the
// delay (in bytes) for the requested data to be played.