summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-20 14:53:15 -0500
committertrav90 <travawine@palemoon.org>2018-10-20 14:53:15 -0500
commit47a01617ea9bb51ecf40d155155299a0278f09f4 (patch)
tree800650056e0aee9fe528438f863a61cba11eecf1 /dom
parent070c2cb24ce1ff32a538346c7c1dbbe83fc7e171 (diff)
downloadUXP-47a01617ea9bb51ecf40d155155299a0278f09f4.tar
UXP-47a01617ea9bb51ecf40d155155299a0278f09f4.tar.gz
UXP-47a01617ea9bb51ecf40d155155299a0278f09f4.tar.lz
UXP-47a01617ea9bb51ecf40d155155299a0278f09f4.tar.xz
UXP-47a01617ea9bb51ecf40d155155299a0278f09f4.zip
Use larger stack for media decoder threads
This increases the thread size for the platform decoder threads (to prevent stack overflows, particularly when decoding av1), while leaving the others at their default values.
Diffstat (limited to 'dom')
-rw-r--r--dom/media/VideoUtils.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/dom/media/VideoUtils.cpp b/dom/media/VideoUtils.cpp
index 2c8b67a9d..80d39a49f 100644
--- a/dom/media/VideoUtils.cpp
+++ b/dom/media/VideoUtils.cpp
@@ -207,8 +207,20 @@ already_AddRefed<SharedThreadPool> GetMediaThreadPool(MediaThreadType aType)
name = "MediaPlayback";
break;
}
- return SharedThreadPool::
+ RefPtr<SharedThreadPool> pool = SharedThreadPool::
Get(nsDependentCString(name), MediaPrefs::MediaThreadPoolDefaultCount());
+
+ // Ensure a larger stack for platform decoder threads
+ if (aType == MediaThreadType::PLATFORM_DECODER) {
+ const uint32_t minStackSize = 512*1024;
+ uint32_t stackSize;
+ MOZ_ALWAYS_SUCCEEDS(pool->GetThreadStackSize(&stackSize));
+ if (stackSize < minStackSize) {
+ MOZ_ALWAYS_SUCCEEDS(pool->SetThreadStackSize(minStackSize));
+ }
+ }
+
+ return pool.forget();
}
bool