Bug 1323847: [MSE] P4. Bump audio buffer size. r=gerald. a=gchang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 16 Dec 2016 16:30:41 +1100
changeset 455662 5cfa37b18bd779738a1793f83c20d7198b4dceff
parent 455661 2e98fec3a9f925a3f313e9d1a20dd03bcc7526ce
child 455663 40e863f1e8180487fa1011ed6ac807a30905d617
push id40304
push userbmo:wpan@mozilla.com
push dateWed, 04 Jan 2017 10:03:07 +0000
reviewersgerald, gchang
bugs1323847, 1320829
milestone52.0a2
Bug 1323847: [MSE] P4. Bump audio buffer size. r=gerald. a=gchang Under some cases YouTube attempts to append more than 10MB of data ahead of currentTime. This causes the appendBuffer to be rejected with QUOTA_EXCEEDED_ERR as as per spec. Bug 1320829 slightly increased the size of the MediaRawData object (by 36 bytes) which on average caused an increase of 470kB of the source buffer size causing the eviction threshold to be crossed quicker. YouTube clears the entire source buffer once a buffer full is reported and reloads it all, causing an audible silence. Bumping the threshold slightly is the only way to get around the problem. MozReview-Commit-ID: HgtHFcZHUG1
dom/media/mediasource/TrackBuffersManager.cpp
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -95,17 +95,17 @@ TrackBuffersManager::TrackBuffersManager
   , mParser(ContainerParser::CreateForMIMEType(aType))
   , mProcessedInput(0)
   , mTaskQueue(aParentDecoder->GetDemuxer()->GetTaskQueue())
   , mParentDecoder(new nsMainThreadPtrHolder<MediaSourceDecoder>(aParentDecoder, false /* strict */))
   , mEnded(false)
   , mVideoEvictionThreshold(Preferences::GetUint("media.mediasource.eviction_threshold.video",
                                                  100 * 1024 * 1024))
   , mAudioEvictionThreshold(Preferences::GetUint("media.mediasource.eviction_threshold.audio",
-                                                 10 * 1024 * 1024))
+                                                 12 * 1024 * 1024))
   , mEvictionState(EvictionState::NO_EVICTION_NEEDED)
   , mMonitor("TrackBuffersManager")
 {
   MOZ_ASSERT(NS_IsMainThread(), "Must be instanciated on the main thread");
 }
 
 TrackBuffersManager::~TrackBuffersManager()
 {