Bug 1282014: check duration when set seek target. r?jwwang draft
authorAlfredo Yang <ayang@mozilla.com>
Fri, 24 Jun 2016 16:00:45 +0800
changeset 381115 69d0bd032abd83c926c54ad64397854fdfe6eb34
parent 380895 d1102663db10b3d4b9358f3cf4e16b7c56902352
child 523886 625bf7e45cb18d88ee3eaefa18fc300e035dade3
push id21396
push userayang@mozilla.com
push dateFri, 24 Jun 2016 08:05:10 +0000
reviewersjwwang
bugs1282014
milestone50.0a1
Bug 1282014: check duration when set seek target. r?jwwang MozReview-Commit-ID: 9ktjaL07sFA
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
--- 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();
       }