Bug 1323847: [MSE] P4. Bump audio buffer size. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 16 Dec 2016 16:30:41 +1100
changeset 450218 7eb2ebacca8c67de220870a5fd58ade6986d7053
parent 450217 e03276697217a63da50df007deccefd20a43fc51
child 539699 92a84b60a052df2e6cd696df83838ebdc41e02d8
push id38795
push userbmo:jyavenard@mozilla.com
push dateFri, 16 Dec 2016 06:22:50 +0000
reviewersgerald
bugs1323847, 1320829
milestone53.0a1
Bug 1323847: [MSE] P4. Bump audio buffer size. r?gerald 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()
 {