Bug 1121876: Treat negative WMF's output sample timestamp as zero. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 19 Jan 2015 22:11:03 +1100
changeset 224479 1d32c46f21434e7501d12a1067c4c1cfc962176d
parent 224478 9ccd38ce999f6442a8ce73d0b07d64539fb6deb5
child 224480 f16ef283fee5dd4036683371aebe9e139656f5c0
push id54246
push userjyavenard@mozilla.com
push dateMon, 19 Jan 2015 11:11:34 +0000
treeherdermozilla-inbound@f16ef283fee5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1121876
milestone38.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 1121876: Treat negative WMF's output sample timestamp as zero. r=cpearce
dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
--- a/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include <algorithm>
 #include "WMFVideoMFTManager.h"
 #include "MediaDecoderReader.h"
 #include "WMFUtils.h"
 #include "ImageContainer.h"
 #include "VideoUtils.h"
 #include "DXVA2Manager.h"
 #include "nsThreadUtils.h"
 #include "Layers.h"
@@ -357,17 +358,17 @@ WMFVideoMFTManager::CreateBasicVideoFram
   b.mPlanes[2].mOffset = 0;
   b.mPlanes[2].mSkip = 0;
 
   Microseconds pts = GetSampleTime(aSample);
   Microseconds duration = GetSampleDuration(aSample);
   nsRefPtr<VideoData> v = VideoData::Create(mVideoInfo,
                                             mImageContainer,
                                             aStreamOffset,
-                                            pts,
+                                            std::max(0LL, pts),
                                             duration,
                                             b,
                                             false,
                                             -1,
                                             ToIntRect(mPictureRegion));
   if (twoDBuffer) {
     twoDBuffer->Unlock2D();
   } else {