bug 1388656 re-initialize the Reverb only once when the ConvolverNode buffer changes r=padenot

MozReview-Commit-ID: IKMK5GYVRBB

--HG--
extra : transplant_source : DT%17%04%FF%A2%3A%C2%E7%E1%99j%0Cs%09%EA2%25%FE%03
extra : histedit_source : 7e88e9ef61f525c1c88aa5d29a70e8facf910f82
This commit is contained in:
Karl Tomlinson 2017-08-08 16:01:57 +12:00
Родитель fe7c8d323e
Коммит 6715046ac3
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -66,7 +66,8 @@ public:
switch (aIndex) { switch (aIndex) {
case SAMPLE_RATE: case SAMPLE_RATE:
mSampleRate = aParam; mSampleRate = aParam;
AdjustReverb(); // The buffer is passed after the sample rate.
// mReverb will be set using this sample rate when the buffer is received.
break; break;
default: default:
NS_ERROR("Bad ConvolverNodeEngine DoubleParameter"); NS_ERROR("Bad ConvolverNodeEngine DoubleParameter");
@ -75,11 +76,7 @@ public:
void SetBuffer(already_AddRefed<ThreadSharedFloatArrayBufferList> aBuffer) override void SetBuffer(already_AddRefed<ThreadSharedFloatArrayBufferList> aBuffer) override
{ {
mBuffer = aBuffer; mBuffer = aBuffer;
AdjustReverb();
}
void AdjustReverb()
{
// Note about empirical tuning (this is copied from Blink) // Note about empirical tuning (this is copied from Blink)
// The maximum FFT size affects reverb performance and accuracy. // The maximum FFT size affects reverb performance and accuracy.
// If the reverb is single-threaded and processes entirely in the real-time audio thread, // If the reverb is single-threaded and processes entirely in the real-time audio thread,