Bug 1253928 - adjust the time passed to RequestVideoData() by the start time to avoid incorrectly skipping key frames. r=jya.
MozReview-Commit-ID: 3Lhglk1EpJv
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1768,17 +1768,20 @@ MediaDecoderStateMachine::RequestVideoDa
// Time the video decode, so that if it's slow, we can increase our low
// audio threshold to reduce the chance of an audio underrun while we're
// waiting for a video decode to complete.
TimeStamp videoDecodeStartTime = TimeStamp::Now();
bool skipToNextKeyFrame = mSentFirstFrameLoadedEvent &&
NeedToSkipToNextKeyframe();
- int64_t currentTime = mState == DECODER_STATE_SEEKING ? 0 : GetMediaTime();
+
+ int64_t currentTime = mState ==
+ DECODER_STATE_SEEKING || !mStartTimeRendezvous->HaveStartTime()
+ ? 0 : GetMediaTime() + mStartTimeRendezvous->StartTime();
SAMPLE_LOG("Queueing video task - queued=%i, decoder-queued=%o, skip=%i, time=%lld",
VideoQueue().GetSize(), mReader->SizeOfVideoQueueInFrames(), skipToNextKeyFrame,
currentTime);
RefPtr<MediaDecoderStateMachine> self = this;
if (mSentFirstFrameLoadedEvent) {
mVideoDataRequest.Begin(