зеркало из https://github.com/mozilla/gecko-dev.git
b=949683 optimize zero-gain in GainNode r=padenot
--HG-- extra : transplant_source : %97Js%1B%23%13%AEb%7F%9E%B5%C4%BEx%84xV%C1%F7%5B
This commit is contained in:
Родитель
544419ae88
Коммит
3d7d128e05
|
@ -70,8 +70,13 @@ public:
|
|||
aOutput->SetNull(WEBAUDIO_BLOCK_SIZE);
|
||||
} else if (mGain.HasSimpleValue()) {
|
||||
// Optimize the case where we only have a single value set as the volume
|
||||
*aOutput = aInput;
|
||||
aOutput->mVolume *= mGain.GetValue();
|
||||
float gain = mGain.GetValue();
|
||||
if (gain == 0.0f) {
|
||||
aOutput->SetNull(WEBAUDIO_BLOCK_SIZE);
|
||||
} else {
|
||||
*aOutput = aInput;
|
||||
aOutput->mVolume *= gain;
|
||||
}
|
||||
} else {
|
||||
// First, compute a vector of gains for each track tick based on the
|
||||
// timeline at hand, and then for each channel, multiply the values
|
||||
|
|
Загрузка…
Ссылка в новой задаче