Bug 1411805 - Update() needs to read some prefs off the main thread. r=gerald

MediaPrefs is our friend.

MozReview-Commit-ID: 3lz5oqUR9R9

--HG--
extra : rebase_source : 31efaf14c29182b00451705b189772aac23acd34
extra : source : 7e9c68fd5fa241fc1d015b352935c2efd0daa1e8
This commit is contained in:
JW Wang 2017-10-24 10:13:30 +08:00
parent 68933a49dc
commit 48defae102
2 changed files with 5 additions and 2 deletions

View File

@ -1306,8 +1306,8 @@ MediaCache::Update()
}
}
int32_t resumeThreshold = Preferences::GetInt("media.cache_resume_threshold", 10);
int32_t readaheadLimit = Preferences::GetInt("media.cache_readahead_limit", 30);
int32_t resumeThreshold = MediaPrefs::MediaCacheResumeThreshold();
int32_t readaheadLimit = MediaPrefs::MediaCacheReadaheadLimit();
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
actions.AppendElement(StreamAction{});

View File

@ -94,6 +94,9 @@ private:
MediaMemoryCachesCombinedLimitPcSysmem, uint32_t, 5);
DECL_MEDIA_PREF("media.cache.resource-index", MediaResourceIndexCache, uint32_t, 8192);
DECL_MEDIA_PREF("media.cache_resume_threshold", MediaCacheResumeThreshold, int32_t, 10);
DECL_MEDIA_PREF("media.cache_readahead_limit", MediaCacheReadaheadLimit, int32_t, 30);
// AudioSink
DECL_MEDIA_PREF("accessibility.monoaudio.enable", MonoAudio, bool, false);
DECL_MEDIA_PREF("media.resampling.enabled", AudioSinkResampling, bool, false);