Bug 1282014: check duration when set seek target. r=jwwang
authorAlfredo Yang <ayang@mozilla.com>
Fri, 24 Jun 2016 16:00:45 +0800
changeset 342712 49f62b49f9aa981f7ae656d53c789a8a1524414d
parent 342711 d347db00f665a7e5895b73f1bd1e8c631ad326a1
child 342713 1319c4c60bbed1d89c1bdc9d042bf7545ed7e6ad
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1282014
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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();
       }