Bug 1428719 - Adjust decrypt throttle to smooth out decrypt bursting when seeking. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Fri, 19 Jan 2018 14:55:12 +1300
changeset 454278 3af31d84214f7cf4617a6798917ed1a0154f569d
parent 454277 ea7705cc940fd908cfec76cf535629b1fbd78ab8
child 454280 6ffbba9ce0ef9ec77a63445f068f2e218ed4830f
child 454289 7b66479caadb664cee58e428d7a9972d8f592be4
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1428719, 1338924
milestone59.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 1428719 - Adjust decrypt throttle to smooth out decrypt bursting when seeking. r=gerald We've had reports from a partner that their EME content is failing after a seek. This is caused by decrypting EME content too fast after a seek triggering bug 1338924. So we need to make our decryption less "bursty". So adjust our decrypt throttling to instead throttle the decrypt to 200ms of content every 100ms of wall-clock-time, rather than 2s of content every 1s of wall-clock-time. This makes us decode more smoothly, and appears to resolve the issue with the partner stream. MozReview-Commit-ID: 1nNuTJrreN
dom/media/platforms/agnostic/eme/DecryptThroughputLimit.h
--- a/dom/media/platforms/agnostic/eme/DecryptThroughputLimit.h
+++ b/dom/media/platforms/agnostic/eme/DecryptThroughputLimit.h
@@ -30,18 +30,18 @@ public:
   // Resolves promise after a delay if necessary in order to reduce the
   // throughput of samples sent through the CDM for decryption.
   RefPtr<ThrottlePromise>
   Throttle(MediaRawData* aSample)
   {
     // We should only have one decrypt request being processed at once.
     MOZ_RELEASE_ASSERT(!mThrottleScheduler.IsScheduled());
 
-    const TimeDuration WindowSize = TimeDuration::FromSeconds(1.0);
-    const TimeDuration MaxThroughput = TimeDuration::FromSeconds(2.0);
+    const TimeDuration WindowSize = TimeDuration::FromSeconds(0.1);
+    const TimeDuration MaxThroughput = TimeDuration::FromSeconds(0.2);
 
     // Forget decrypts that happened before the start of our window.
     const TimeStamp now = TimeStamp::Now();
     while (!mDecrypts.empty() && mDecrypts.front().mTimestamp < now - WindowSize) {
       mDecrypts.pop_front();
     }
 
     // How much time duration of the media would we have decrypted inside the