| 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 03f271e22b151adf1122d91bb9eacc0f75ea5a3d..42265ea53f1cde59bcfc3591af9f7ad3b429e385 100644
|
| --- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc
|
| +++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
|
| @@ -5,6 +5,7 @@
|
| #include "content/renderer/pepper/pepper_platform_audio_output_impl.h"
|
|
|
| #include "base/bind.h"
|
| +#include "base/command_line.h"
|
| #include "base/logging.h"
|
| #include "base/message_loop_proxy.h"
|
| #include "build/build_config.h"
|
| @@ -13,6 +14,7 @@
|
| #include "content/renderer/media/audio_hardware.h"
|
| #include "content/renderer/media/audio_message_filter.h"
|
| #include "content/renderer/render_thread_impl.h"
|
| +#include "media/base/media_switches.h"
|
|
|
| namespace content {
|
|
|
| @@ -121,11 +123,17 @@ bool PepperPlatformAudioOutputImpl::Initialize(
|
|
|
| media::AudioParameters::Format format;
|
| const int kMaxFramesForLowLatency = 2047;
|
| - // 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() &&
|
| - frames_per_buffer <= kMaxFramesForLowLatency &&
|
| - frames_per_buffer % audio_hardware::GetOutputBufferSize() == 0) {
|
| +
|
| + const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
|
| + if (cmd_line->HasSwitch(switches::kEnableAudioOutputResampler)) {
|
| + // Rely on AudioOutputResampler to handle any inconsistencies between the
|
| + // hardware params required for low latency and the requested params.
|
| + format = media::AudioParameters::AUDIO_PCM_LOW_LATENCY;
|
| + } else if (sample_rate == audio_hardware::GetOutputSampleRate() &&
|
| + frames_per_buffer <= kMaxFramesForLowLatency &&
|
| + frames_per_buffer % audio_hardware::GetOutputBufferSize() == 0) {
|
| + // 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.
|
| format = media::AudioParameters::AUDIO_PCM_LOW_LATENCY;
|
| } else {
|
| format = media::AudioParameters::AUDIO_PCM_LINEAR;
|
|
|