Bug 1483174 use float constants with float delay time variables r=padenot

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2018-08-16 11:09:03 +00:00
Родитель f1bd968c5c
Коммит 298f16043a
2 изменённых файлов: 4 добавлений и 4 удалений

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

@ -128,7 +128,7 @@ DelayBuffer::ReadChannels(const float aPerFrameDelays[WEBAUDIO_BLOCK_SIZE],
for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; ++i) {
float currentDelay = aPerFrameDelays[i];
MOZ_ASSERT(currentDelay >= 0.0);
MOZ_ASSERT(currentDelay >= 0.0f);
MOZ_ASSERT(currentDelay <= (mChunks.Length() - 1) * WEBAUDIO_BLOCK_SIZE);
// Interpolate two input frames in case the read position does not match
@ -148,7 +148,7 @@ DelayBuffer::ReadChannels(const float aPerFrameDelays[WEBAUDIO_BLOCK_SIZE],
// considered for determining totalChannelCount.
// mVolume is not set on default initialized chunks so also handle null
// chunks specially.
if (interpolationFactor != 0.0 && !mChunks[readChunk].IsNull()) {
if (interpolationFactor != 0.0f && !mChunks[readChunk].IsNull()) {
int readOffset = OffsetForPosition(positions[tick]);
UpdateUpmixChannels(readChunk, totalChannelCount,
aChannelInterpretation);
@ -160,7 +160,7 @@ DelayBuffer::ReadChannels(const float aPerFrameDelays[WEBAUDIO_BLOCK_SIZE],
}
}
interpolationFactor = 1.0 - interpolationFactor;
interpolationFactor = 1.0f - interpolationFactor;
}
}
}

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

@ -37,7 +37,7 @@ namespace WebCore {
// The value of 2 milliseconds is larger than the largest delay which exists in any HRTFKernel from the default HRTFDatabase (0.0136 seconds).
// We ASSERT the delay values used in process() with this value.
const float MaxDelayTimeSeconds = 0.002;
const float MaxDelayTimeSeconds = 0.002f;
const int UninitializedAzimuth = -1;
const unsigned RenderingQuantum = WEBAUDIO_BLOCK_SIZE;