Bug 1143575. Don't report negative frame delays. r=cpearce

This commit is contained in:
Robert O'Callahan
2015-05-25 15:42:24 +12:00
parent fd1108d2e0
commit 61c5028a30

View File

@@ -174,7 +174,11 @@ double HTMLVideoElement::MozFrameDelay()
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
VideoFrameContainer* container = GetVideoFrameContainer();
return container ? container->GetFrameDelay() : 0;
// Hide negative delays. Frame timing tweaks in the compositor (e.g.
// adding a bias value to prevent multiple dropped/duped frames when
// frame times are aligned with composition times) may produce apparent
// negative delay, but we shouldn't report that.
return container ? std::max(0.0, container->GetFrameDelay()) : 0.0;
}
bool HTMLVideoElement::MozHasAudio() const