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

Unified Diff: third_party/WebKit/Source/platform/audio/AudioDelayDSPKernel.cpp

Issue 1657763002: Handle NaN in the Audio delay curves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/audio/AudioDelayDSPKernel.cpp
diff --git a/third_party/WebKit/Source/platform/audio/AudioDelayDSPKernel.cpp b/third_party/WebKit/Source/platform/audio/AudioDelayDSPKernel.cpp
index de7e6b9775d2652a523bccce4f3b3301a073ebfa..1814a4521563dd1335316c2354fbf8be9c817d9c 100644
--- a/third_party/WebKit/Source/platform/audio/AudioDelayDSPKernel.cpp
+++ b/third_party/WebKit/Source/platform/audio/AudioDelayDSPKernel.cpp
@@ -119,7 +119,10 @@ void AudioDelayDSPKernel::process(const float* source, float* destination, size_
for (unsigned i = 0; i < framesToProcess; ++i) {
if (sampleAccurate) {
delayTime = delayTimes[i];
- delayTime = clampTo(delayTime, 0.0, maxTime);
+ if (std::isnan(delayTime))
+ delayTime = maxTime;
+ else
+ delayTime = clampTo(delayTime, 0.0, maxTime);
m_currentDelayTime = delayTime;
} else {
// Approach desired delay time.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698