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

Unified Diff: Source/core/platform/audio/AudioResamplerKernel.cpp

Issue 20294002: Fix trailing whitespace in .cpp, .h, and .idl files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 5 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 | « Source/core/platform/audio/AudioResamplerKernel.h ('k') | Source/core/platform/audio/AudioSourceProvider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/audio/AudioResamplerKernel.cpp
diff --git a/Source/core/platform/audio/AudioResamplerKernel.cpp b/Source/core/platform/audio/AudioResamplerKernel.cpp
index 311a828067de9d6a9e71d3ea727025239c976c1f..8b9b457517a987eee9f79ff5da835f5ed4191274 100644
--- a/Source/core/platform/audio/AudioResamplerKernel.cpp
+++ b/Source/core/platform/audio/AudioResamplerKernel.cpp
@@ -34,7 +34,7 @@
using namespace std;
namespace WebCore {
-
+
const size_t AudioResamplerKernel::MaxFramesToProcess = 128;
AudioResamplerKernel::AudioResamplerKernel(AudioResampler* resampler)
@@ -51,7 +51,7 @@ AudioResamplerKernel::AudioResamplerKernel(AudioResampler* resampler)
float* AudioResamplerKernel::getSourcePointer(size_t framesToProcess, size_t* numberOfSourceFramesNeededP)
{
ASSERT(framesToProcess <= MaxFramesToProcess);
-
+
// Calculate the next "virtual" index. After process() is called, m_virtualReadIndex will equal this value.
double nextFractionalIndex = m_virtualReadIndex + framesToProcess * rate();
@@ -78,11 +78,11 @@ void AudioResamplerKernel::process(float* destination, size_t framesToProcess)
ASSERT(framesToProcess <= MaxFramesToProcess);
float* source = m_sourceBuffer.data();
-
+
double rate = this->rate();
rate = max(0.0, rate);
rate = min(AudioResampler::MaxRate, rate);
-
+
// Start out with the previous saved values (if any).
if (m_fillIndex > 0) {
source[0] = m_lastValues[0];
@@ -91,7 +91,7 @@ void AudioResamplerKernel::process(float* destination, size_t framesToProcess)
// Make a local copy.
double virtualReadIndex = m_virtualReadIndex;
-
+
// Sanity check source buffer access.
ASSERT(framesToProcess > 0);
ASSERT(virtualReadIndex >= 0 && 1 + static_cast<unsigned>(virtualReadIndex + (framesToProcess - 1) * rate) < m_sourceBuffer.size());
@@ -110,7 +110,7 @@ void AudioResamplerKernel::process(float* destination, size_t framesToProcess)
*destination++ = static_cast<float>(sample);
virtualReadIndex += rate;
- }
+ }
// Save the last two sample-frames which will later be used at the beginning of the source buffer the next time around.
int readIndex = static_cast<int>(virtualReadIndex);
« no previous file with comments | « Source/core/platform/audio/AudioResamplerKernel.h ('k') | Source/core/platform/audio/AudioSourceProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698