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

Unified Diff: content/browser/renderer_host/media/audio_common.cc

Issue 9416085: Increase the buffer size in AudioRendererImpl to fix muted playback rate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT 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
Index: content/browser/renderer_host/media/audio_common.cc
diff --git a/content/browser/renderer_host/media/audio_common.cc b/content/browser/renderer_host/media/audio_common.cc
deleted file mode 100644
index 7126ddba42de9cc974b46432b3c58d0ecf9417ec..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/media/audio_common.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/renderer_host/media/audio_common.h"
-
-#include "base/time.h"
-#include "media/audio/audio_parameters.h"
-
-// The minimum number of samples in a hardware packet.
-// This value is selected so that we can handle down to 5khz sample rate.
-static const int kMinSamplesPerHardwarePacket = 1024;
-
-// The maximum number of samples in a hardware packet.
-// This value is selected so that we can handle up to 192khz sample rate.
-static const int kMaxSamplesPerHardwarePacket = 64 * 1024;
-
-// This constant governs the hardware audio buffer size, this value should be
-// chosen carefully.
-// This value is selected so that we have 8192 samples for 48khz streams.
-static const int kMillisecondsPerHardwarePacket = 170;
-
-uint32 SelectSamplesPerPacket(const AudioParameters& params) {
- // Select the number of samples that can provide at least
- // |kMillisecondsPerHardwarePacket| worth of audio data.
- int samples = kMinSamplesPerHardwarePacket;
- while (samples <= kMaxSamplesPerHardwarePacket &&
- samples * base::Time::kMillisecondsPerSecond <
- params.sample_rate * kMillisecondsPerHardwarePacket) {
- samples *= 2;
- }
- return samples;
-}
« no previous file with comments | « content/browser/renderer_host/media/audio_common.h ('k') | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698