Bug 881959 - Handle self-connection. r=ehsan

--HG--
extra : rebase_source : f2d4a0a28cb85668f80c58d1a56926f65ea40e72
This commit is contained in:
Paul Adenot 2013-09-16 17:37:27 +02:00
Родитель a37178b018
Коммит ae09c349ad
1 изменённых файлов: 15 добавлений и 8 удалений

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

@ -488,15 +488,22 @@ MediaStreamGraphImpl::UpdateStreamOrderForStream(mozilla::LinkedList<MediaStream
}
if (cycleFound && !delayNodePresent) {
// If we have detected a cycle, the previous loop should exit with stream
// == iter. Go back in the cycle and mute all nodes we find.
MOZ_ASSERT(iter);
do {
// There can't be non-AudioNodeStream here, MediaStreamAudio{Source,
// Destination}Node are connected to regular MediaStreams, but they can't be
// in a cycle (there is no content API to do so).
MOZ_ASSERT(iter->AsAudioNodeStream());
// == iter, or the node is connected to itself. Go back in the cycle and
// mute all nodes we find, or just mute the node itself.
if (!iter) {
// The node is connected to itself.
iter = aStack->getLast();
iter->AsAudioNodeStream()->Mute();
} while((iter = iter->getNext()));
} else {
MOZ_ASSERT(iter);
do {
// There can't be non-AudioNodeStream here, MediaStreamAudio{Source,
// Destination}Node are connected to regular MediaStreams, but they can't be
// in a cycle (there is no content API to do so).
MOZ_ASSERT(iter->AsAudioNodeStream());
iter->AsAudioNodeStream()->Mute();
} while((iter = iter->getNext()));
}
}
return;
}