Bug 1282014: check duration when set seek target. r?jwwang
MozReview-Commit-ID: 9ktjaL07sFA
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -786,20 +786,21 @@ WMFVideoMFTManager::Output(int64_t aStre
LOG("Excessive Video MFTDecoder returning success but no output; giving up");
mGotExcessiveNullOutput = true;
return E_FAIL;
}
continue;
}
if (mSeekTargetThreshold.isSome()) {
media::TimeUnit pts = GetSampleTime(sample);
- if (!pts.IsValid()) {
+ media::TimeUnit duration = GetSampleDuration(sample);
+ if (!pts.IsValid() || !duration.IsValid()) {
return E_FAIL;
}
- if (pts < mSeekTargetThreshold.ref()) {
+ if ((pts + duration) < mSeekTargetThreshold.ref()) {
LOG("Dropping video frame which pts is smaller than seek target.");
// It is necessary to clear the pointer to release the previous output
// buffer.
sample = nullptr;
continue;
}
mSeekTargetThreshold.reset();
}