blob: b212a70d4a32d91ccd3259aef2c586ec0f550cef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
Copied from: https://hg.mozilla.org/releases/mozilla-esr38/rev/6d43ff33bd55
Security advisory: https://www.mozilla.org/en-US/security/advisories/mfsa2016-01/
Mozilla Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1223670
# HG changeset patch
# User Karl Tomlinson <karlt+@karlt.net>
# Date 1451362442 -46800
# Node ID 6d43ff33bd552b8f7a34e4105cf5bcc0a8c8ea8c
# Parent f746c38d160ea29088c15cacae44f3662befaec5
bug 1223670 throw not supported when creating a node from a stream with different channel r=baku a=abillings
diff --git a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
--- a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
+++ b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
@@ -51,21 +51,29 @@ MediaStreamAudioSourceNode::Create(Audio
}
return node.forget();
}
void
MediaStreamAudioSourceNode::Init(DOMMediaStream* aMediaStream, ErrorResult& aRv)
{
+ MOZ_ASSERT(aMediaStream);
+ MediaStream* inputStream = aMediaStream->GetStream();
+ MediaStreamGraph* graph = Context()->Graph();
+ if (NS_WARN_IF(graph != inputStream->Graph())) {
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+ return;
+ }
+
mInputStream = aMediaStream;
AudioNodeEngine* engine = new MediaStreamAudioSourceNodeEngine(this);
- mStream = Context()->Graph()->CreateAudioNodeExternalInputStream(engine);
+ mStream = graph->CreateAudioNodeExternalInputStream(engine);
ProcessedMediaStream* outputStream = static_cast<ProcessedMediaStream*>(mStream.get());
- mInputPort = outputStream->AllocateInputPort(aMediaStream->GetStream(),
+ mInputPort = outputStream->AllocateInputPort(inputStream,
MediaInputPort::FLAG_BLOCK_INPUT);
mInputStream->AddConsumerToKeepAlive(static_cast<nsIDOMEventTarget*>(this));
PrincipalChanged(mInputStream); // trigger enabling/disabling of the connector
mInputStream->AddPrincipalChangeObserver(this);
}
MediaStreamAudioSourceNode::~MediaStreamAudioSourceNode()
|