Bug 1371290: P2. Override sample duration if unknown. r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 08 Jun 2017 13:48:39 +0200
changeset 411204 52586ef104b1740b82d994f4572272ad3ad54d3d
parent 411203 381c3ee3d00e12bec3f9873f17867b0e1c68c914
child 411205 ddabdf4ac22249028c167b015610ee24d4b69d62
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1371290, 1222874
milestone55.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 1371290: P2. Override sample duration if unknown. r=mattwoodrow The VP9 decoder doesn't properly set the sample duration, leading to all samples being marked as having a zero duration. The compositor drops those frames incorrectly. This issue will be addressed in bug 1222874. MozReview-Commit-ID: JQdtTL4nAN
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -1034,17 +1034,22 @@ WMFVideoMFTManager::Output(int64_t aStre
   // Frame should be non null only when we succeeded.
   MOZ_ASSERT((frame != nullptr) == SUCCEEDED(hr));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
   NS_ENSURE_TRUE(frame, E_FAIL);
 
   aOutData = frame;
   // Set the potentially corrected pts and duration.
   aOutData->mTime = pts;
-  aOutData->mDuration = duration;
+  // The VP9 decoder doesn't provide a valid duration. AS VP9 doesn't have a
+  // concept of pts vs dts and have no latency. We can as such use the last
+  // known input duration.
+  aOutData->mDuration = (mStreamType == VP9 && duration == TimeUnit::Zero())
+                        ? mLastDuration
+                        : duration;
 
   if (mNullOutputCount) {
     mGotValidOutputAfterNullOutput = true;
   }
 
   return S_OK;
 }