Bug 1353607. P6 - use TimeUnit in CheckSlowDecoding(). r=kikuo

MozReview-Commit-ID: 524aRA1uUaQ

--HG--
extra : rebase_source : 9983ee9167c7e6420d7ebd529be8a985027c40d5
extra : intermediate-source : 56e1187c40b910d8cc233bd1dd86c963d0bdb249
extra : source : 29470ceae137940b6432a402249a56a82572adf0
This commit is contained in:
JW Wang 2017-03-28 17:27:56 +08:00
parent 1058fbba54
commit 285e8bf172

View File

@ -815,13 +815,12 @@ private:
}
TimeDuration decodeTime = TimeStamp::Now() - aDecodeStart;
int64_t adjustedTime = THRESHOLD_FACTOR * DurationToUsecs(decodeTime);
if (adjustedTime > mMaster->mLowAudioThreshold.ToMicroseconds()
auto adjusted = TimeUnit::FromTimeDuration(decodeTime * THRESHOLD_FACTOR);
if (adjusted > mMaster->mLowAudioThreshold
&& !mMaster->HasLowBufferedData())
{
mMaster->mLowAudioThreshold = std::min(
TimeUnit::FromMicroseconds(adjustedTime),
mMaster->mAmpleAudioThreshold);
adjusted, mMaster->mAmpleAudioThreshold);
mMaster->mAmpleAudioThreshold = std::max(
mMaster->mLowAudioThreshold * THRESHOLD_FACTOR,