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
--- 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;
}