summaryrefslogtreecommitdiffstats
path: root/media/audio/simple_sources.cc
diff options
context:
space:
mode:
authorslan <slan@chromium.org>2015-04-20 12:39:14 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-20 19:39:25 +0000
commit43a1d72b243b3762cf04af4cf75aa53744a31f8a (patch)
tree84aecdef8159374ab55ef679336de608b4520964 /media/audio/simple_sources.cc
parent901d507acf54e758902e3f857640f74938a429ac (diff)
downloadchromium_src-43a1d72b243b3762cf04af4cf75aa53744a31f8a.zip
chromium_src-43a1d72b243b3762cf04af4cf75aa53744a31f8a.tar.gz
chromium_src-43a1d72b243b3762cf04af4cf75aa53744a31f8a.tar.bz2
WavAudioHandler no longer keeps state with AudioParameters.
Keeping internal state with AudioParameters was causing ambiguity among callers of WavAudioHandler, particularly in longer wav files, where the total number of frames exceeded default buffer lengths (1024 frames in many cases). Construction of AudioParameters, which is intended to describe an audio stream rather than an audio file, has been moved outside of WavAudioHandler, and replaced by explicit accessors for parameters describing the wav audio chunk. Context (Google internal): https://eureka-internal-review.git.corp.google.com/#/c/21997/ BUG=b/16680624 Review URL: https://codereview.chromium.org/1063633008 Cr-Commit-Position: refs/heads/master@{#325894}
Diffstat (limited to 'media/audio/simple_sources.cc')
-rw-r--r--media/audio/simple_sources.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/media/audio/simple_sources.cc b/media/audio/simple_sources.cc
index caf4c4c..877f9fd 100644
--- a/media/audio/simple_sources.cc
+++ b/media/audio/simple_sources.cc
@@ -186,10 +186,9 @@ void FileSource::LoadWavFile(const base::FilePath& path_to_wav_file) {
// modify the wav file's audio parameters since we'll be reading small slices
// of it at a time and not the whole thing (like 10 ms at a time).
AudioParameters file_audio_slice(
- wav_audio_handler_->params().format(),
- wav_audio_handler_->params().channel_layout(),
- wav_audio_handler_->params().sample_rate(),
- wav_audio_handler_->params().bits_per_sample(),
+ AudioParameters::AUDIO_PCM_LOW_LATENCY,
+ GuessChannelLayout(wav_audio_handler_->num_channels()),
+ wav_audio_handler_->sample_rate(), wav_audio_handler_->bits_per_sample(),
params_.frames_per_buffer());
file_audio_converter_.reset(
@@ -225,7 +224,7 @@ double FileSource::ProvideInput(AudioBus* audio_bus_into_converter,
&bytes_written);
wav_file_read_pos_ += bytes_written;
return 1.0;
-};
+}
void FileSource::OnError(AudioOutputStream* stream) {
}