Bug 995543 - Unbreak libc++ build after bug 982490 by using more portable mozilla::Abs. r=jesup
authorJan Beich <jbeich@tormail.org>
Sun, 13 Apr 2014 15:41:07 -0400
changeset 178293 d0874032eebac33f4e495cec2da7ed60ed08fe39
parent 178292 dd79dc4f978ceac242f4a10ec68b9a6c07fa6781
child 178294 d0012e4d8a9a4cd0dd99bd0afd76541f7fecb870
push id26580
push usercbook@mozilla.com
push dateMon, 14 Apr 2014 13:20:46 +0000
treeherdermozilla-central@9b2c4a85a5e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs995543, 982490
milestone31.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 995543 - Unbreak libc++ build after bug 982490 by using more portable mozilla::Abs. r=jesup
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
 /* 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 "MediaStreamGraphImpl.h"
 #include "mozilla/LinkedList.h"
+#include "mozilla/MathAlgorithms.h"
 #include "mozilla/unused.h"
 
 #include "AudioSegment.h"
 #include "VideoSegment.h"
 #include "nsContentUtils.h"
 #include "nsIAppShell.h"
 #include "nsIObserver.h"
 #include "nsServiceManagerUtils.h"
@@ -898,17 +899,17 @@ MediaStreamGraphImpl::PlayAudio(MediaStr
     // sample, or play a sample twice.
     TrackTicks offset = track->TimeToTicksRoundDown(GraphTimeToStreamTime(aStream, aFrom));
     if (!audioOutput.mLastTickWritten) {
         audioOutput.mLastTickWritten = offset;
     }
     if (audioOutput.mLastTickWritten != offset) {
       // If there is a global underrun of the MSG, this property won't hold, and
       // we reset the sample count tracking.
-      if (std::abs(audioOutput.mLastTickWritten - offset) != 1) {
+      if (mozilla::Abs(audioOutput.mLastTickWritten - offset) != 1) {
         audioOutput.mLastTickWritten = offset;
       } else {
         offset = audioOutput.mLastTickWritten;
       }
     }
 
     // We don't update aStream->mBufferStartTime here to account for
     // time spent blocked. Instead, we'll update it in UpdateCurrentTime after the