mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 804387. Part 10: Add a mechanism for ensuring that we don't attempt to allocate an input port if the input node is not hooked up to MSG yet. r=roc
--HG-- extra : rebase_source : dc3a202cbb94c266f6df4b0c1b5247522fc76658
This commit is contained in:
parent
6d8b72a707
commit
438db37746
@ -28,6 +28,10 @@ public:
|
||||
}
|
||||
AudioSourceNode::DestroyMediaStream();
|
||||
}
|
||||
virtual bool SupportsMediaStreams() const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioBufferSourceNode, AudioSourceNode)
|
||||
|
@ -165,6 +165,7 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
input->mInputNode = this;
|
||||
input->mInputPort = aInput;
|
||||
input->mOutputPort = aOutput;
|
||||
if (SupportsMediaStreams() && aDestination.mStream) {
|
||||
// Connect streams in the MediaStreamGraph
|
||||
MOZ_ASSERT(aDestination.mStream->AsProcessedStream());
|
||||
ProcessedMediaStream* ps =
|
||||
@ -172,6 +173,7 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput,
|
||||
input->mStreamPort =
|
||||
ps->AllocateInputPort(mStream, MediaInputPort::FLAG_BLOCK_OUTPUT);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioNode::Disconnect(uint32_t aOutput, ErrorResult& aRv)
|
||||
|
@ -60,6 +60,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// This method should be overridden to return true in nodes
|
||||
// which support being hooked up to the Media Stream graph.
|
||||
virtual bool SupportsMediaStreams() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(AudioNode)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user