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

Unified Diff: content/renderer/media/audio_renderer_impl.cc

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright years Created 8 years, 9 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
« no previous file with comments | « content/renderer/media/audio_input_device.cc ('k') | content/renderer/media/render_audiosourceprovider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_renderer_impl.cc
diff --git a/content/renderer/media/audio_renderer_impl.cc b/content/renderer/media/audio_renderer_impl.cc
index 66219747b88ee1381c32e5f71187c043320a1dd6..112be6393f3608b6d3ad8748f818fa2ae797d801 100644
--- a/content/renderer/media/audio_renderer_impl.cc
+++ b/content/renderer/media/audio_renderer_impl.cc
@@ -60,23 +60,17 @@ bool AudioRendererImpl::OnInitialize(int bits_per_channel,
// does not currently support all the sample-rates that we require.
// Please see: http://code.google.com/p/chromium/issues/detail?id=103627
// for more details.
- audio_parameters_ = AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
- channel_layout,
- sample_rate,
- bits_per_channel,
- 0);
+ audio_parameters_.Reset(
+ AudioParameters::AUDIO_PCM_LINEAR,
+ channel_layout, sample_rate, bits_per_channel,
+ audio_hardware::GetHighLatencyOutputBufferSize(sample_rate));
bytes_per_second_ = audio_parameters_.GetBytesPerSecond();
DCHECK(sink_.get());
if (!is_initialized_) {
- sink_->Initialize(
- audio_hardware::GetHighLatencyOutputBufferSize(sample_rate),
- audio_parameters_.channels,
- audio_parameters_.sample_rate,
- audio_parameters_.format,
- this);
+ sink_->Initialize(audio_parameters_, this);
sink_->Start();
is_initialized_ = true;
@@ -193,8 +187,7 @@ size_t AudioRendererImpl::Render(const std::vector<float*>& audio_data,
GetPlaybackRate())));
}
- uint32 bytes_per_frame =
- audio_parameters_.bits_per_sample * audio_parameters_.channels / 8;
+ int bytes_per_frame = audio_parameters_.GetBytesPerFrame();
const size_t buf_size = number_of_frames * bytes_per_frame;
scoped_array<uint8> buf(new uint8[buf_size]);
« no previous file with comments | « content/renderer/media/audio_input_device.cc ('k') | content/renderer/media/render_audiosourceprovider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698