Bug 1179110 - Fix ComputePlaybackRate. r=jww, a=ritu
authorBobby Holley <bobbyholley@gmail.com>
Wed, 01 Jul 2015 16:57:25 -0700
changeset 281447 09219bc6153f5ad217f040d35678198e5b37d8eb
parent 281446 4e6fead2c1f394ae4ced0d2163171689ade74b32
child 281448 807f336af403aae079c363cea69d0948ff18d2a2
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjww, ritu
bugs1179110
milestone41.0a2
Bug 1179110 - Fix ComputePlaybackRate. r=jww, a=ritu This is a regression from https://hg.mozilla.org/mozilla-central/rev/3ead3466f84a
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -851,17 +851,17 @@ MediaDecoder::GetStatistics()
 double MediaDecoder::ComputePlaybackRate(bool* aReliable)
 {
   GetReentrantMonitor().AssertCurrentThreadIn();
   MOZ_ASSERT(NS_IsMainThread() || OnStateMachineTaskQueue() || OnDecodeTaskQueue());
 
   int64_t length = mResource ? mResource->GetLength() : -1;
   if (!IsNaN(mDuration) && !mozilla::IsInfinite<double>(mDuration) && length >= 0) {
     *aReliable = true;
-    return length * mDuration;
+    return length / mDuration;
   }
   return mPlaybackStatistics->GetRateAtLastStop(aReliable);
 }
 
 void MediaDecoder::UpdatePlaybackRate()
 {
   MOZ_ASSERT(NS_IsMainThread() || OnStateMachineTaskQueue());
   GetReentrantMonitor().AssertCurrentThreadIn();