Commit e72bb599 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Increase the default audio buffer size for encrypted streams

This partially reverts commit 251e255f.

After mojo CDM was enabled by default, with the performance gain, we
changed the audio buffer size back to the original value at 200ms,
which is the same as the size as clear playback.

Recently, we found cases where we still have performance issues for
encrypted audio. Given the fact that users are super sensitive to audio
glitches, and encrypted playback always has worse performance than clear
playback, it makes sense to use a larger buffer size.

This CL changes the audio buffer size back to 500ms. It may increase
the start-to-play time slightly, but should help reduce rebuffers during
playback.

Bug: 718161,879970
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I41909d3fc3356df119b21fe720ebe8cafad206a5
Reviewed-on: https://chromium-review.googlesource.com/c/1297329Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602165}
parent 6efcb3e3
...@@ -60,11 +60,11 @@ static const int kMaxCapacityInSeconds = 3; ...@@ -60,11 +60,11 @@ static const int kMaxCapacityInSeconds = 3;
static const int kStartingCapacityInMs = 200; static const int kStartingCapacityInMs = 200;
// The minimum size in ms for the |audio_buffer_| for encrypted streams. // The minimum size in ms for the |audio_buffer_| for encrypted streams.
// Encrypted audio typically has some extra decryption overhead than clear // Set this to be larger than |kStartingCapacityInMs| because the performance of
// audio. Thus keep a separate capacity here. The value may or may not be // encrypted playback is always worse than clear playback, due to decryption and
// the same as kStartingCapacityInMs above. For more historical context, // potentially IPC overhead. For the context, see https://crbug.com/403462,
// see https://crbug.com/403462. // https://crbug.com/718161 and https://crbug.com/879970.
static const int kStartingCapacityForEncryptedInMs = kStartingCapacityInMs; static const int kStartingCapacityForEncryptedInMs = 500;
AudioRendererAlgorithm::AudioRendererAlgorithm() AudioRendererAlgorithm::AudioRendererAlgorithm()
: channels_(0), : channels_(0),
......
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