Bug 1120014 - Initialize MediaSourceReader::mLast{Audio,Video}Time to 0 rather than -1. r=rillian
There isn't actually any initialization code that sets them at 0. Instead, we
currently rely on the fact that our first decoder ends up active regardless of
what its buffered range reports. So as long as invoking the first Request{Audio,Video}Data
is resolved, this ends up ok. But while that is usually the case, it isn't _always_
the case, especially in the case where the MP4Reader rejects with WAITING_FOR_DATA.
--- a/dom/media/mediasource/MediaSourceReader.cpp
+++ b/dom/media/mediasource/MediaSourceReader.cpp
@@ -41,18 +41,18 @@ extern PRLogModuleInfo* GetMediaSourceAP
#define EOS_FUZZ_US 125000
using mozilla::dom::TimeRanges;
namespace mozilla {
MediaSourceReader::MediaSourceReader(MediaSourceDecoder* aDecoder)
: MediaDecoderReader(aDecoder)
- , mLastAudioTime(-1)
- , mLastVideoTime(-1)
+ , mLastAudioTime(0)
+ , mLastVideoTime(0)
, mPendingSeekTime(-1)
, mPendingStartTime(-1)
, mPendingEndTime(-1)
, mPendingCurrentTime(-1)
, mWaitingForSeekData(false)
, mPendingSeeks(0)
, mSeekResult(NS_OK)
, mTimeThreshold(-1)