Bug 1121876 - Treat negative WMF's output sample timestamp as zero. r=cpearce, a=sledru
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 19 Jan 2015 22:11:03 +1100
changeset 242951 e017341d2486
parent 242950 506cfb41b8f3
child 242952 cd88be2b57ac
push id4344
push userryanvm@gmail.com
push date2015-01-20 17:02 +0000
treeherdermozilla-beta@ea7deca21c27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, sledru
bugs1121876
milestone36.0
Bug 1121876 - Treat negative WMF's output sample timestamp as zero. r=cpearce, a=sledru
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 {