Bug 572235 - Increase default media cache size from 50MB to 500MB. r=roc
--- a/content/media/nsMediaCache.cpp
+++ b/content/media/nsMediaCache.cpp
@@ -636,17 +636,17 @@ nsMediaCache::WriteCacheFile(PRInt64 aOf
return NS_OK;
}
static PRInt32 GetMaxBlocks()
{
// We look up the cache size every time. This means dynamic changes
// to the pref are applied.
// Cache size is in KB
- PRInt32 cacheSize = nsContentUtils::GetIntPref("media.cache_size", 50*1024);
+ PRInt32 cacheSize = nsContentUtils::GetIntPref("media.cache_size", 500*1024);
PRInt64 maxBlocks = PRInt64(cacheSize)*1024/nsMediaCache::BLOCK_SIZE;
maxBlocks = PR_MAX(maxBlocks, 1);
return PRInt32(PR_MIN(maxBlocks, PR_INT32_MAX));
}
PRInt32
nsMediaCache::FindBlockForIncomingData(TimeStamp aNow,
nsMediaCacheStream* aStream)
--- a/content/media/nsMediaCache.h
+++ b/content/media/nsMediaCache.h
@@ -91,17 +91,17 @@
* is marked "delete on close" so it will automatically disappear in the
* event of a browser crash or shutdown.
*
* The media cache is block-based. Streams are divided into blocks of a
* fixed size (currently 4K) and we cache blocks. A single cache contains
* blocks for all streams.
*
* The cache size is controlled by the media.cache_size preference
- * (which is in KB). The default size is 50MB.
+ * (which is in KB). The default size is 500MB.
*
* The replacement policy predicts a "time of next use" for each block
* in the cache. When we need to free a block, the block with the latest
* "time of next use" will be evicted. Blocks are divided into
* different classes, each class having its own predictor:
* FREE_BLOCK: these blocks are effectively infinitely far in the future;
* a free block will always be chosen for replacement before other classes
* of blocks.
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -149,17 +149,17 @@ pref("browser.chrome.image_icons.max_siz
pref("browser.triple_click_selects_paragraph", true);
// When loading <video> or <audio>, check for Access-Control-Allow-Origin
// header, and disallow the connection if not present or permitted.
pref("media.enforce_same_site_origin", false);
// Media cache size in kilobytes
-pref("media.cache_size", 51200);
+pref("media.cache_size", 512000);
#ifdef MOZ_OGG
pref("media.ogg.enabled", true);
#endif
#ifdef MOZ_WAVE
pref("media.wave.enabled", true);
#endif
#ifdef MOZ_WEBM