Commit 764ca25e authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Reduce AudioDeviceThread stack size to 256kB.

It ought to be enough for everyone! Tests on Window show that normal
audio playback only uses 4kB and WebRTC uses ~68kB, so 256kB
seems enough to cover our use cases.

Fixed: 1141563
Change-Id: I4f119c3985347b45b4d934432792efb0d6e2dc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2500432
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821449}
parent 3cedc9c7
......@@ -8,6 +8,7 @@
#include "base/check_op.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
namespace media {
......@@ -45,8 +46,17 @@ AudioDeviceThread::AudioDeviceThread(Callback* callback,
: callback_(callback),
thread_name_(thread_name),
socket_(std::move(socket)) {
CHECK(base::PlatformThread::CreateWithPriority(0, this, &thread_handle_,
thread_priority));
#if defined(ARCH_CPU_X86)
// Audio threads don't need a huge stack, they don't have a message loop and
// they are used exclusively for polling the next frame of audio. See
// https://crbug.com/1141563 for discussion.
constexpr size_t kStackSize = 256 * 1024;
#else
constexpr size_t kStackSize = 0; // Default.
#endif
CHECK(base::PlatformThread::CreateWithPriority(
kStackSize, this, &thread_handle_, thread_priority));
DCHECK(!thread_handle_.is_null());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment