Bug 1526044 - part1 : do not append duplicated stream. r=padenot
authoralwu <alwu@mozilla.com>
Fri, 15 Feb 2019 14:41:22 +0000
changeset 459596 506828839f9fd9d97ad06e2afa668604c415006d
parent 459595 a92bdbd9b9822f7c25ddd8f5ea28187125d00f7d
child 459597 53830102bf765ff8d8fb28953bea2ab177d39d6d
push id35563
push userccoroiu@mozilla.com
push dateSat, 16 Feb 2019 09:36:04 +0000
treeherdermozilla-central@1cfd69d05aa1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1526044
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1526044 - part1 : do not append duplicated stream. r=padenot Different nodes might have same AudioParam, so we shouldn't append same stream multiple times. Differential Revision: https://phabricator.services.mozilla.com/D19450
dom/media/webaudio/AudioContext.cpp
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -890,17 +890,17 @@ nsTArray<MediaStream*> AudioContext::Get
     if (s) {
       streams.AppendElement(s);
     }
     // Add the streams for the AudioParam that have an AudioNode input.
     const nsTArray<RefPtr<AudioParam>>& audioParams = node->OutputParams();
     if (!audioParams.IsEmpty()) {
       for (auto& param : audioParams) {
         s = param->GetStream();
-        if (s) {
+        if (s && !streams.Contains(s)) {
           streams.AppendElement(s);
         }
       }
     }
   }
   return streams;
 }