Bug 1500238 output null from StereoPannerNode when input is null r=padenot

This is necessary for efficient processing of silence, and is consistent with
behavior of other nodes.

A null block current has a single channel of silence, which isn't aligned with
the current spec, but is consistent with the direction of
https://github.com/WebAudio/web-audio-api/issues/1471#issuecomment-405668690

Depends on D9210

Differential Revision: https://phabricator.services.mozilla.com/D9211

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2018-10-19 09:25:25 +00:00
Родитель 49ec510d94
Коммит 6e306581c2
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -113,13 +113,13 @@ public:
{
// The output of this node is always stereo, no matter what the inputs are.
MOZ_ASSERT(aInput.ChannelCount() <= 2);
aOutput->AllocateChannels(2);
bool monoToStereo = aInput.ChannelCount() == 1;
if (aInput.IsNull()) {
// If input is silent, so is the output
SetToSilentStereoBlock(aOutput);
aOutput->SetNull(WEBAUDIO_BLOCK_SIZE);
} else if (mPan.HasSimpleValue()) {
aOutput->AllocateChannels(2);
float panning = mPan.GetValue();
// If the panning is 0.0, we can simply copy the input to the
// output with gain applied, up-mixing to stereo if needed.
@ -138,6 +138,7 @@ public:
panning <= 0);
}
} else {
aOutput->AllocateChannels(2);
float computedGain[2*WEBAUDIO_BLOCK_SIZE + 4];
bool onLeft[WEBAUDIO_BLOCK_SIZE];