Bug 1252766 - Remove MediaDecoderStateMachine::mDecodeToSeekTarget which is never read. r=kaku.
MozReview-Commit-ID: KAArYtFqUKQ
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -226,17 +226,16 @@ MediaDecoderStateMachine::MediaDecoderSt
mVideoCompleted(false, "MediaDecoderStateMachine::mVideoCompleted"),
mNotifyMetadataBeforeFirstFrame(false),
mDispatchedEventToDecode(false),
mQuickBuffering(false),
mMinimizePreroll(false),
mDecodeThreadWaiting(false),
mDropAudioUntilNextDiscontinuity(false),
mDropVideoUntilNextDiscontinuity(false),
- mDecodeToSeekTarget(false),
mCurrentTimeBeforeSeek(0),
mCorruptFrames(60),
mDecodingFirstFrame(true),
mSentLoadedMetadataEvent(false),
mSentFirstFrameLoadedEvent(false),
mSentPlaybackEndedEvent(false),
mOutputStreamManager(new OutputStreamManager()),
mResource(aDecoder->GetResource()),
@@ -1019,17 +1018,16 @@ MediaDecoderStateMachine::CheckIfSeekCom
}
SAMPLE_LOG("CheckIfSeekComplete() audioSeekComplete=%d videoSeekComplete=%d",
audioSeekComplete, videoSeekComplete);
if (audioSeekComplete && videoSeekComplete) {
NS_ASSERTION(AudioQueue().GetSize() <= 1, "Should decode at most one sample");
NS_ASSERTION(VideoQueue().GetSize() <= 1, "Should decode at most one sample");
- mDecodeToSeekTarget = false;
SeekCompleted();
}
}
bool
MediaDecoderStateMachine::IsAudioDecoding()
{
MOZ_ASSERT(OnTaskQueue());
@@ -1641,17 +1639,16 @@ MediaDecoderStateMachine::InitiateSeek()
mSeekRequest.Begin(InvokeAsync(DecodeTaskQueue(), mReader.get(), __func__,
&MediaDecoderReader::Seek, seekTarget,
Duration().ToMicroseconds())
->Then(OwnerThread(), __func__,
[self] (media::TimeUnit) -> void {
self->mSeekRequest.Complete();
// We must decode the first samples of active streams, so we can determine
// the new stream time. So dispatch tasks to do that.
- self->mDecodeToSeekTarget = true;
self->EnsureAudioDecodeTaskQueued();
self->EnsureVideoDecodeTaskQueued();
}, [self] (nsresult aResult) -> void {
self->mSeekRequest.Complete();
MOZ_ASSERT(NS_FAILED(aResult), "Cancels should also disconnect mSeekRequest");
self->DecodeError();
}));
}
@@ -2400,17 +2397,16 @@ MediaDecoderStateMachine::Reset()
mDecodedAudioEndTime = 0;
mAudioCompleted = false;
mVideoCompleted = false;
AudioQueue().Reset();
VideoQueue().Reset();
mFirstVideoFrameAfterSeek = nullptr;
mDropAudioUntilNextDiscontinuity = true;
mDropVideoUntilNextDiscontinuity = true;
- mDecodeToSeekTarget = false;
mMetadataRequest.DisconnectIfExists();
mAudioDataRequest.DisconnectIfExists();
mAudioWaitRequest.DisconnectIfExists();
mVideoDataRequest.DisconnectIfExists();
mVideoWaitRequest.DisconnectIfExists();
mSeekRequest.DisconnectIfExists();
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -1116,20 +1116,16 @@ private:
// These two flags are true when we need to drop decoded samples that
// we receive up to the next discontinuity. We do this when we seek;
// the first sample in each stream after the seek is marked as being
// a "discontinuity".
bool mDropAudioUntilNextDiscontinuity;
bool mDropVideoUntilNextDiscontinuity;
- // True if we need to decode forwards to the seek target inside
- // mCurrentSeekTarget.
- bool mDecodeToSeekTarget;
-
// Track the current seek promise made by the reader.
MozPromiseRequestHolder<MediaDecoderReader::SeekPromise> mSeekRequest;
// We record the playback position before we seek in order to
// determine where the seek terminated relative to the playback position
// we were at before the seek.
int64_t mCurrentTimeBeforeSeek;