зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 2938c2e1f7e7 (bug 867203) since part 1 had to be backed out for conflicts
This commit is contained in:
Родитель
a1f0bc5292
Коммит
6941e106a7
|
@ -412,6 +412,7 @@ AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* aContext)
|
|||
, mOffset(0.0)
|
||||
, mDuration(std::numeric_limits<double>::min())
|
||||
, mPlaybackRate(new AudioParam(this, SendPlaybackRateToStream, 1.0f))
|
||||
, mPannerNode(nullptr)
|
||||
, mLoop(false)
|
||||
, mStartCalled(false)
|
||||
, mOffsetAndDurationRemembered(false)
|
||||
|
|
|
@ -37,6 +37,15 @@ public:
|
|||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
void UnregisterPannerNode() {
|
||||
mPannerNode = nullptr;
|
||||
}
|
||||
|
||||
void RegisterPannerNode(PannerNode* aPannerNode) {
|
||||
mPannerNode = aPannerNode;
|
||||
}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioBufferSourceNode, AudioNode)
|
||||
|
||||
|
@ -139,6 +148,7 @@ private:
|
|||
double mDuration;
|
||||
nsRefPtr<AudioBuffer> mBuffer;
|
||||
nsRefPtr<AudioParam> mPlaybackRate;
|
||||
PannerNode* mPannerNode;
|
||||
SelfReference<AudioBufferSourceNode> mPlayingRef; // a reference to self while playing
|
||||
bool mLoop;
|
||||
bool mStartCalled;
|
||||
|
|
|
@ -258,6 +258,13 @@ AudioContext::UnregisterScriptProcessorNode(ScriptProcessorNode* aNode)
|
|||
mScriptProcessorNodes.RemoveEntry(aNode);
|
||||
}
|
||||
|
||||
static PLDHashOperator
|
||||
UnregisterPannerNodeOn(nsPtrHashKey<AudioBufferSourceNode>* aEntry, void* aData)
|
||||
{
|
||||
aEntry->GetKey()->UnregisterPannerNode();
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
static PLDHashOperator
|
||||
FindConnectedSourcesOn(nsPtrHashKey<PannerNode>* aEntry, void* aData)
|
||||
{
|
||||
|
@ -268,6 +275,7 @@ FindConnectedSourcesOn(nsPtrHashKey<PannerNode>* aEntry, void* aData)
|
|||
void
|
||||
AudioContext::UpdatePannerSource()
|
||||
{
|
||||
mAudioBufferSourceNodes.EnumerateEntries(UnregisterPannerNodeOn, nullptr);
|
||||
mPannerNodes.EnumerateEntries(FindConnectedSourcesOn, nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -482,6 +482,9 @@ PannerNode::FindConnectedSources()
|
|||
mSources.Clear();
|
||||
std::set<AudioNode*> cycleSet;
|
||||
FindConnectedSources(this, mSources, cycleSet);
|
||||
for (unsigned i = 0; i < mSources.Length(); i++) {
|
||||
mSources[i]->RegisterPannerNode(this);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче