Commit 251e255f authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Decrease the default audio buffer size for encrypted streams

This partially reverts https://codereview.chromium.org/2858393002/

Now mojo CDM is enabled by default, there's no contention on the main
render thread any more. Change the audio buffer size back to the
original value.

Note that it's still possible that audio performance is not as good as
clear audio due to extra decryption overhead. So still keep a separate
kStartingCapacityForEncryptedInMs constant to keep the ability to choose
a different capacity for encrypted audio. Will watch our metrics to see
whether we need more adjustment on this value.

Bug: 718161
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I7420950d05e35892d1ef595a77ee716f8a716d2f
Reviewed-on: https://chromium-review.googlesource.com/946864Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541584}
parent 1fc707c0
......@@ -59,14 +59,11 @@ static const int kMaxCapacityInSeconds = 3;
static const int kStartingCapacityInMs = 200;
// The minimum size in ms for the |audio_buffer_| for encrypted streams.
// This is a temporary workaround for http://crbug.com/718161. Encrypted
// audio may be decrypted on the renderer main thread, so if that thread
// is blocked for a significant amount of time, decoding can stall. By
// maintaining a larger audio buffer we are more resilient to underflows
// caused by long running main thread tasks.
// TODO(watk,xhwang): Delete this when decrypting moves to the media thread
// (http://crbug.com/403462).
static const int kStartingCapacityForEncryptedInMs = 500;
// Encrypted audio typically has some extra decryption overhead than clear
// audio. Thus keep a separate capacity here. The value may or may not be
// the same as kStartingCapacityInMs above. For more historical context,
// see https://crbug.com/403462.
static const int kStartingCapacityForEncryptedInMs = kStartingCapacityInMs;
AudioRendererAlgorithm::AudioRendererAlgorithm()
: 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