Index: content/renderer/pepper/pepper_platform_audio_output_impl.cc |
diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.cc b/content/renderer/pepper/pepper_platform_audio_output_impl.cc |
index 1b3a02ec6a49fed997b63aa5ed5ed054f3cf7136..a2c67aa0d75fee77fb97066c0c5c0e1863946299 100644 |
--- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc |
+++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc |
@@ -28,8 +28,8 @@ PepperPlatformAudioOutputImpl::~PepperPlatformAudioOutputImpl() { |
} |
bool PepperPlatformAudioOutputImpl::Initialize( |
- uint32_t sample_rate, |
- uint32_t sample_count, |
+ uint32_t samples_per_second, |
+ uint32_t samples_per_packet, |
webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client) { |
DCHECK(client); |
// Make sure we don't call init more than once. |
@@ -37,20 +37,19 @@ bool PepperPlatformAudioOutputImpl::Initialize( |
client_ = client; |
- AudioParameters params; |
+ AudioParameters::Format format; |
const uint32_t kMaxSampleCountForLowLatency = 2048; |
// Use the low latency back end if the client request is compatible, and |
// the sample count is low enough to justify using AUDIO_PCM_LOW_LATENCY. |
- if (sample_rate == audio_hardware::GetOutputSampleRate() && |
- sample_count <= kMaxSampleCountForLowLatency && |
- sample_count % audio_hardware::GetOutputBufferSize() == 0) |
- params.format = AudioParameters::AUDIO_PCM_LOW_LATENCY; |
+ if (samples_per_second == audio_hardware::GetOutputSampleRate() && |
+ samples_per_packet <= kMaxSampleCountForLowLatency && |
+ samples_per_packet % audio_hardware::GetOutputBufferSize() == 0) |
+ format = AudioParameters::AUDIO_PCM_LOW_LATENCY; |
else |
- params.format = AudioParameters::AUDIO_PCM_LINEAR; |
- params.channels = 2; |
- params.sample_rate = sample_rate; |
- params.bits_per_sample = 16; |
- params.samples_per_packet = sample_count; |
+ format = AudioParameters::AUDIO_PCM_LINEAR; |
+ |
+ AudioParameters params(format, CHANNEL_LAYOUT_STEREO, samples_per_second, |
+ 16, samples_per_packet); |
ChildProcess::current()->io_message_loop()->PostTask( |
FROM_HERE, |