Bug 943461. Part 19: nsSpeechTask should explicitly finish its audio track before finishing the stream. r=eitan
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 13 Dec 2013 01:33:01 +1300
changeset 162336 7677ea877c089aec20d93fa55e49f1fc12fa1752
parent 162335 0279107b81d321e2c5279d2e7c33fc9563d1be73
child 162337 1ebe4da27dd5abadd1fe30dc9e11f004240bc4e3
push idunknown
push userunknown
push dateunknown
reviewerseitan
bugs943461
milestone29.0a1
Bug 943461. Part 19: nsSpeechTask should explicitly finish its audio track before finishing the stream. r=eitan
content/media/webspeech/synth/nsSpeechTask.cpp
--- a/content/media/webspeech/synth/nsSpeechTask.cpp
+++ b/content/media/webspeech/synth/nsSpeechTask.cpp
@@ -210,18 +210,17 @@ nsSpeechTask::SendAudioNative(int16_t* a
 
   return NS_OK;
 }
 
 void
 nsSpeechTask::SendAudioImpl(int16_t* aData, uint32_t aDataLen)
 {
   if (aDataLen == 0) {
-    // XXX: We should end the track too, an undetermined bug does not allow that.
-    mStream->Finish();
+    mStream->EndAllTrackAndFinish();
     return;
   }
 
   nsRefPtr<mozilla::SharedBuffer> samples =
     SharedBuffer::Create(aDataLen * sizeof(int16_t));
   int16_t* frames = static_cast<int16_t*>(samples->Data());
 
   for (uint32_t i = 0; i < aDataLen; i++) {