b=944851 don't consider AudioNode input when getting AudioParam values on the main thread r=ehsan

--HG--
extra : transplant_source : %15o4%BAA%1F%D4%87%01%CD%B3H%A1T%B0%88%27%9F%A1e
This commit is contained in:
Karl Tomlinson 2014-01-07 12:53:47 +13:00
parent b0df417f11
commit 49afc90fac

View File

@ -50,15 +50,7 @@ public:
// getting the value of an a-rate AudioParam for each tick inside an
// AudioNodeEngine implementation.
template<class TimeType>
float GetValueAtTime(TimeType aTime, size_t aCounter = 0)
{
MOZ_ASSERT(aCounter < WEBAUDIO_BLOCK_SIZE);
MOZ_ASSERT(!aCounter || !HasSimpleValue());
// Mix the value of the AudioParam itself with that of the AudioNode inputs.
return BaseClass::GetValueAtTime(static_cast<TimeType>(aTime + aCounter)) +
(mStream ? AudioNodeInputValue(aCounter) : 0.0f);
}
float GetValueAtTime(TimeType aTime, size_t aCounter = 0);
private:
float AudioNodeInputValue(size_t aCounter) const;
@ -68,6 +60,28 @@ protected:
nsRefPtr<MediaStream> mStream;
};
template<> inline float
AudioParamTimeline::GetValueAtTime(double aTime, size_t aCounter)
{
MOZ_ASSERT(!aCounter);
// Getting an AudioParam value on an AudioNode does not consider input from
// other AudioNodes, which is managed only on the graph thread.
return BaseClass::GetValueAtTime(aTime);
}
template<> inline float
AudioParamTimeline::GetValueAtTime(int64_t aTime, size_t aCounter)
{
MOZ_ASSERT(aCounter < WEBAUDIO_BLOCK_SIZE);
MOZ_ASSERT(!aCounter || !HasSimpleValue());
// Mix the value of the AudioParam itself with that of the AudioNode inputs.
return BaseClass::GetValueAtTime(static_cast<int64_t>(aTime + aCounter)) +
(mStream ? AudioNodeInputValue(aCounter) : 0.0f);
}
}
}