Bug 1190676 - Part 11 - Fix consumers: Web Speech. r=anatal,eitan
authorPaul Adenot <paul@paul.cx>
Tue, 25 Aug 2015 10:30:49 +0200
changeset 260115 192e65f2ddc2a414bd1322eb91b9478ccb52c246
parent 260114 7d6a186524179f9435f2e72ad5156473199ead85
child 260116 ec2415cfb5381badb554677a390bd1b974c71d22
push id29301
push userryanvm@gmail.com
push dateMon, 31 Aug 2015 19:21:13 +0000
treeherdermozilla-central@cafb1c90f794 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersanatal, eitan
bugs1190676
milestone43.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 1190676 - Part 11 - Fix consumers: Web Speech. r=anatal,eitan
dom/media/webspeech/synth/nsSpeechTask.cpp
dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
--- a/dom/media/webspeech/synth/nsSpeechTask.cpp
+++ b/dom/media/webspeech/synth/nsSpeechTask.cpp
@@ -138,17 +138,17 @@ nsSpeechTask::~nsSpeechTask()
     mPort = nullptr;
   }
 }
 
 void
 nsSpeechTask::Init(ProcessedMediaStream* aStream)
 {
   if (aStream) {
-    mStream = MediaStreamGraph::GetInstance()->CreateSourceStream(nullptr);
+    mStream = aStream->Graph()->CreateSourceStream(nullptr);
     mPort = aStream->AllocateInputPort(mStream, 0);
     mIndirectAudio = false;
   } else {
     mIndirectAudio = true;
   }
   mInited = true;
 }
 
--- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
+++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
@@ -773,17 +773,19 @@ nsSynthVoiceRegistry::SpeakImpl(VoiceDat
 
   DebugOnly<nsresult> rv = aVoice->mService->GetServiceType(&serviceType);
   NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to get speech service type");
 
   if (serviceType == nsISpeechService::SERVICETYPE_INDIRECT_AUDIO) {
     aTask->Init(nullptr);
   } else {
     if (!mStream) {
-      mStream = MediaStreamGraph::GetInstance()->CreateTrackUnionStream(nullptr);
+      mStream =
+        MediaStreamGraph::GetInstance(MediaStreamGraph::AUDIO_THREAD_DRIVER,
+                                      AudioChannel::Normal)->CreateTrackUnionStream(nullptr);
     }
     aTask->Init(mStream);
   }
 
   aVoice->mService->Speak(aText, aVoice->mUri, aVolume, aRate, aPitch, aTask);
 }
 
 } // namespace dom