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

Unified Diff: third_party/WebKit/Source/modules/webaudio/PannerNode.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/audio/EqualPowerPanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
index 939c9a7d80dc99b002963efc786e10ff67cb9fbe..3ef6973cfde00c5a161c5d4c4713fce1c49cfeed 100644
--- a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
@@ -131,16 +131,10 @@ void PannerHandler::process(size_t framesToProcess)
MutexTryLocker tryListenerLocker(listener()->listenerLock());
if (tryLocker.locked() && tryListenerLocker.locked()) {
- // HRTFDatabase should be loaded before proceeding when the panning model is HRTF.
- if (m_panningModel == Panner::PanningModelHRTF && !listener()->isHRTFDatabaseLoaded()) {
- if (context()->hasRealtimeConstraint()) {
- // Realtime AudioContext's cannot block on the HRTFDatabase
- // loader. Instead, copy the input to the output so we can at
- // least hear something until the database is ready.
- destination->copyFrom(*source, m_channelInterpretation);
- return;
- }
-
+ if (!context()->hasRealtimeConstraint() && m_panningModel == Panner::PanningModelHRTF) {
+ // For an OfflineAudioContext, we need to make sure the HRTFDatabase
+ // is loaded before proceeding. For realtime contexts, we don't
+ // have to wait. The HRTF panner handles that case itself.
listener()->waitForHRTFDatabaseLoaderThreadCompletion();
}
@@ -161,7 +155,7 @@ void PannerHandler::process(size_t framesToProcess)
azimuthElevation(&azimuth, &elevation);
- m_panner->pan(azimuth, elevation, source, destination, framesToProcess);
+ m_panner->pan(azimuth, elevation, source, destination, framesToProcess, internalChannelInterpretation());
// Get the distance and cone gain.
float totalGain = distanceConeGain();
@@ -231,7 +225,7 @@ void PannerHandler::processSampleAccurateValues(AudioBus* destination, const Aud
totalGain[k] = calculateDistanceConeGain(pannerPosition, orientation, listenerPosition);
}
- m_panner->panWithSampleAccurateValues(azimuth, elevation, source, destination, framesToProcess);
+ m_panner->panWithSampleAccurateValues(azimuth, elevation, source, destination, framesToProcess, internalChannelInterpretation());
destination->copyWithSampleAccurateGainValuesFrom(*destination, totalGain, framesToProcess);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/audio/EqualPowerPanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698