author | Barbara Guida <bar@FreeBSD.org> |
Fri, 16 Jan 2015 17:50:00 +0100 | |
changeset 224487 | 9577955e37cc9e228cdb8f7c8401a6cc2e571556 |
parent 224486 | 33ea628dd337bf1cba3daf8b36a07a4e40621375 |
child 224488 | 837613fc3a49ae3bca3e2651348e14c53803774c |
push id | 28131 |
push user | cbook@mozilla.com |
push date | Mon, 19 Jan 2015 15:10:25 +0000 |
treeherder | mozilla-central@f8e4fdb89a05 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | dholbert |
bugs | 1122586, 1073716 |
milestone | 38.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
|
--- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -13,16 +13,17 @@ #include <stdint.h> #include "MediaDecoderStateMachine.h" #include "MediaDecoderStateMachineScheduler.h" #include "AudioSink.h" #include "nsTArray.h" #include "MediaDecoder.h" #include "MediaDecoderReader.h" +#include "mozilla/MathAlgorithms.h" #include "mozilla/mozalloc.h" #include "VideoUtils.h" #include "mozilla/dom/TimeRanges.h" #include "nsDeque.h" #include "AudioSegment.h" #include "VideoSegment.h" #include "ImageContainer.h" #include "nsComponentManagerUtils.h" @@ -160,17 +161,17 @@ static const uint32_t QUICK_BUFFERING_LO // QUICK_BUFFERING_LOW_DATA_USECS. static_assert(QUICK_BUFFERING_LOW_DATA_USECS <= AMPLE_AUDIO_USECS, "QUICK_BUFFERING_LOW_DATA_USECS is too large"); // The amount of instability we tollerate in calls to // MediaDecoderStateMachine::UpdateEstimatedDuration(); changes of duration // less than this are ignored, as they're assumed to be the result of // instability in the duration estimation. -static const int64_t ESTIMATED_DURATION_FUZZ_FACTOR_USECS = USECS_PER_S / 2; +static const uint64_t ESTIMATED_DURATION_FUZZ_FACTOR_USECS = USECS_PER_S / 2; static TimeDuration UsecsToDuration(int64_t aUsecs) { return TimeDuration::FromMicroseconds(aUsecs); } static int64_t DurationToUsecs(TimeDuration aDuration) { return static_cast<int64_t>(aDuration.ToSeconds() * USECS_PER_S); } @@ -1444,17 +1445,17 @@ void MediaDecoderStateMachine::SetDurati mEndTime = mStartTime + aDuration; } void MediaDecoderStateMachine::UpdateEstimatedDuration(int64_t aDuration) { AssertCurrentThreadInMonitor(); int64_t duration = GetDuration(); if (aDuration != duration && - std::abs(aDuration - duration) > ESTIMATED_DURATION_FUZZ_FACTOR_USECS) { + mozilla::Abs(aDuration - duration) > ESTIMATED_DURATION_FUZZ_FACTOR_USECS) { SetDuration(aDuration); nsCOMPtr<nsIRunnable> event = NS_NewRunnableMethod(mDecoder, &MediaDecoder::DurationChanged); NS_DispatchToMainThread(event); } } void MediaDecoderStateMachine::SetMediaEndTime(int64_t aEndTime)