mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
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.
This commit is contained in:
parent
ad02b504a6
commit
8dd06e64c3
1 changed files with 13 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue