Bug 943461. Part 1: A stream is fully finished when all its tracks have finished playing out. r=padenot

--HG--
extra : rebase_source : 0efa4353ea22ffd52d550331623098d275382148
Bug 943461. Part 2: Add assertion to catch cases where we NotifyOuput after NotifyFinished. r=padenot

--HG--
extra : rebase_source : 8653b45d9f1dde5ff40bd2621ee9cda527bb6be1
Bug 943461. Part 3: Like part 1, blocking calculations should note that a stream is only fully ended whenall of its tracks have finished playing out. r=padenot

--HG--
extra : rebase_source : 892cd92396e317d1c46a2f67d0061dc3d513de98
Bug 943461. Part 4: Fix TrackUnionStream track-ended calculation to catch cases where a track ends at the point where the input stream is completely blocked. r=padenot
We can have a situation where interval.mStart == interval.mEnd always (because
the input stream is always blocking) but the track has actually ended.

--HG--
extra : rebase_source : d2ffdf56b51196dfaab15beb145db33dd97c749e
Bug 943461. Part 5: Don't allow a stream to finish before it has produced output up to mStateComputedTime. r=padenot

--HG--
extra : rebase_source : 9bf003c246b63b1dd64665024533fda74a8e1fa4
Bug 943461. Part 6: Fix test to handle automatic stop of MediaRecorder. r=rlin

--HG--
extra : rebase_source : 15e9a2042c4ac940afe9e6d524fab7a4d75e8675
Bug 943461. Part 7: DecodedStreamData::mNextVideoTime is not relative to mStartTime. r=cpearce

--HG--
extra : rebase_source : 63b4fe1859c362683b3d3192114263dd7910b183
Bug 943461. Part 8: When a MediaDecoder is decoding to a stream, run PlaybackEnded when the stream finishes. r=padenot

--HG--
extra : rebase_source : 92c8b55c5d8330bcf8242d379bc608fa3d30bc6b
Bug 943461. Part 9: Handle absence of INCLUDE_TRAILING_BLOCKED_INTERVAL flag correctly. r=padenot

--HG--
extra : rebase_source : b7bf3e56e0332dcf1357f959891ff39a86f89cd1
Bug 943461. Part 10: Fix and simplify setting of mNextMainThreadFinished. r=padenot

--HG--
extra : rebase_source : 4530688441600d6538cd9a9662466762ca845ff9
Bug 943461. Part 11: Don't tear down an OfflineAudioContext until its current time has actually reached its end, to ensure that all relevant stream state changes have been forwarded to the main thread. r=padenot

--HG--
extra : rebase_source : 32b9a4cf4c39edfabf5be17cec50a676f1ad4641
Bug 947796. Must convert milliseconds to MediaTime correctly. r=padenot

--HG--
extra : rebase_source : 8cbe26ea9f5189df38985a57fdd447e858885b18
Bug 943461. Part 12: Remove spurious ScriptProcessorNode from test. r=karl

--HG--
extra : rebase_source : e902519b5e1d7bbd7f60545147edd8241e4d9455
Bug 943461. Part 13: Keep producing silence in AudioNodeStreams' mLastChunks even after they've finished r=padenot
Without this the last before-finished audio block gets picked up by downstream
ObtainInputBlock calls.

--HG--
extra : rebase_source : d7f804cea59454bdb0aa5931d19bcc123e0d16cb
Bug 943461. Part 15: Make MediaDecoder set its currentTime based on the decoded stream's time directly, if we are decoding to a stream. r=cpearce

--HG--
extra : rebase_source : 35fe51dbec3107d7dae801a5a179c5ef5fa53725
Bug 943461. Part 16: Fix test_streams_element_capture_reset to make its expected current times be independent of possibly-buggy v.currentTime. r=cpearce

--HG--
extra : rebase_source : ed67ce62701d5386bc4ba1ba98edd8e4d3946748
Bug 943461. Part 17: MediaDecoderStateMachine::StopPlayback should not set mPlayDuration based on real time, but on whatever we're using for GetClock. r=cpearce

--HG--
extra : rebase_source : 855fd9cb87cfc5824676697cc73dee12ab816c16
Bug 943461. Part 18: Ensure AudioBufferSourceNode's engine always produces an audio block when ProduceAudioBlock is called, and add an assertion to catch this kind of error directly. r=karl

--HG--
extra : rebase_source : e6ae51dc34f5567998af3b299acd48dd10e8394e
Bug 943461. Part 19: nsSpeechTask should explicitly finish its audio track before finishing the stream. r=eitan

--HG--
extra : rebase_source : 8c927ef0f777e1c5c5fe39361df1185e73a06111
Bug 943461. Part 20: Don't revive an offline MediaStreamGraph that has finished. Instead, process any pending events using their RunInShutdown sequence. r=padenot

--HG--
extra : rebase_source : 7d2d6282418cf0a339684ad651f8c29876acf496