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

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

Issue 2170973002: HRTF panner should handle the case of no loaded HRTF database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 4 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
Index: third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
diff --git a/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp b/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
index bed5654772da8ebc306510e3cf9b29a6d754d678..2dc9727e6212c771647cad668312e8410c348e06 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFPanner.cpp
@@ -117,7 +117,7 @@ int HRTFPanner::calculateDesiredAzimuthIndexAndBlend(double azimuth, double& azi
return desiredAzimuthIndex;
}
-void HRTFPanner::pan(double desiredAzimuth, double elevation, const AudioBus* inputBus, AudioBus* outputBus, size_t framesToProcess)
+void HRTFPanner::pan(double desiredAzimuth, double elevation, const AudioBus* inputBus, AudioBus* outputBus, size_t framesToProcess, AudioBus::ChannelInterpretation channelInterpretation)
{
unsigned numInputChannels = inputBus ? inputBus->numberOfChannels() : 0;
@@ -134,9 +134,8 @@ void HRTFPanner::pan(double desiredAzimuth, double elevation, const AudioBus* in
}
HRTFDatabase* database = m_databaseLoader->database();
- ASSERT(database);
if (!database) {
- outputBus->zero();
+ outputBus->copyFrom(*inputBus, channelInterpretation);
return;
}
@@ -292,7 +291,7 @@ void HRTFPanner::pan(double desiredAzimuth, double elevation, const AudioBus* in
}
}
-void HRTFPanner::panWithSampleAccurateValues(double* desiredAzimuth, double* elevation, const AudioBus* inputBus, AudioBus* outputBus, size_t framesToProcess)
+void HRTFPanner::panWithSampleAccurateValues(double* desiredAzimuth, double* elevation, const AudioBus* inputBus, AudioBus* outputBus, size_t framesToProcess, AudioBus::ChannelInterpretation channelInterpretation)
{
// Sample-accurate (a-rate) HRTF panner is not implemented, just k-rate. Just grab the current
// azimuth/elevation and use that.
@@ -302,7 +301,7 @@ void HRTFPanner::panWithSampleAccurateValues(double* desiredAzimuth, double* ele
// one output sample for each possibly different impulse response. That N^2. Previously, we
// used an FFT to do them all at once for a complexity of N/log2(N). Hence, N/log2(N) times
// more complex.)
- pan(desiredAzimuth[0], elevation[0], inputBus, outputBus, framesToProcess);
+ pan(desiredAzimuth[0], elevation[0], inputBus, outputBus, framesToProcess, channelInterpretation);
}
double HRTFPanner::tailTime() const
« no previous file with comments | « third_party/WebKit/Source/platform/audio/HRTFPanner.h ('k') | third_party/WebKit/Source/platform/audio/Panner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698