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

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

Issue 9479012: Merge 123292 - Increase the buffer size in AudioRendererImpl to fix muted playback rate (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 years, 10 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/content_browser.gypi ('k') | media/audio/audio_util.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
===================================================================
--- content/renderer/media/audio_renderer_impl.cc (revision 123772)
+++ content/renderer/media/audio_renderer_impl.cc (working copy)
@@ -16,26 +16,6 @@
#include "media/audio/audio_util.h"
#include "media/base/filter_host.h"
-// We define GetBufferSizeForSampleRate() instead of using
-// GetAudioHardwareBufferSize() in audio_util because we're using
-// the AUDIO_PCM_LINEAR flag, instead of AUDIO_PCM_LOW_LATENCY,
-// which the audio_util functions assume.
-//
-// See: http://code.google.com/p/chromium/issues/detail?id=103627
-// for a more detailed description of the subtleties.
-static size_t GetBufferSizeForSampleRate(int sample_rate) {
- // kNominalBufferSize has been tested on Windows, Mac OS X, and Linux
- // using the low-latency audio codepath (SyncSocket implementation)
- // with the AUDIO_PCM_LINEAR flag.
- const size_t kNominalBufferSize = 2048;
-
- if (sample_rate <= 48000)
- return kNominalBufferSize;
- else if (sample_rate <= 96000)
- return kNominalBufferSize * 2;
- return kNominalBufferSize * 4;
-}
-
AudioRendererImpl::AudioRendererImpl(media::AudioRendererSink* sink)
: AudioRendererBase(),
bytes_per_second_(0),
@@ -91,7 +71,7 @@
if (!is_initialized_) {
sink_->Initialize(
- GetBufferSizeForSampleRate(sample_rate),
+ media::SelectSamplesPerPacket(sample_rate),
audio_parameters_.channels,
audio_parameters_.sample_rate,
audio_parameters_.format,
« no previous file with comments | « content/content_browser.gypi ('k') | media/audio/audio_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698