Bug 943461. Part 19: nsSpeechTask should explicitly finish its audio track before finishing the stream. r=eitan
--- 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++) {