Commit b0b91f9c authored by Raymond Toy's avatar Raymond Toy Committed by Commit Bot

Enable CHECKs in ABSN::ComputeOutput

The debugging in
https://chromium-review.googlesource.com/c/chromium/src/+/2411424
doesn't provide any new information.  Thus, change the DCHECKs into
CHECKs to see if something is out-of-bounds.

Only do this for a short time and revert if nothing is found since
this has performance implications.

Bug: 1116104
Change-Id: I89c385c24694de5c01edd6a3856743a658282d20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422890
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809347}
parent 6320d4b5
...@@ -422,13 +422,15 @@ unsigned AudioBufferSourceHandler::ComputeOutput( ...@@ -422,13 +422,15 @@ unsigned AudioBufferSourceHandler::ComputeOutput(
if (read0[k] == read1[k] && read0[k] >= 1) { if (read0[k] == read1[k] && read0[k] >= 1) {
// We're at the end of the buffer, so just linearly extrapolate from // We're at the end of the buffer, so just linearly extrapolate from
// the last two samples. // the last two samples.
DCHECK_LT(read0[k], buffer_length); // TODO(crbug.com/1116104). Remove this CHECK once the problem is
// solved.
CHECK_LT(read0[k], buffer_length);
float sample1 = source[read0[k] - 1]; float sample1 = source[read0[k] - 1];
float sample2 = source[read0[k]]; float sample2 = source[read0[k]];
sample = sample2 + (sample2 - sample1) * interp_factor[k]; sample = sample2 + (sample2 - sample1) * interp_factor[k];
} else { } else {
DCHECK_LT(read0[k], buffer_length); CHECK_LT(read0[k], buffer_length);
DCHECK_LT(read1[k], buffer_length); CHECK_LT(read1[k], buffer_length);
// TODO(crbug.com/1116104). If read1[k] is out-of-bounds, just return // TODO(crbug.com/1116104). If read1[k] is out-of-bounds, just return
// 0. Remove this when the underlying problem is fixed. // 0. Remove this when the underlying problem is fixed.
if (read1[k] >= buffer_length) { if (read1[k] >= buffer_length) {
......
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