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

Add CHECK to help determine source of crash

Add a CHECK before we break out of the loop in ComputeIndices.  This
has never happened in my testing, so this is just a guess.  If we do
get crashes, perhaps we can get better information about what's
happening.

This is important because if we do exit the loop early, we're not
telling ComputeOutput about it and the read indices may not be set up
correctly for that.  Also, update frames_processed to tell ComputeOutput
how many values were computed so ComputeOutput doesn't compute more
outputs than needed.

I think letting this bake for a week or so will be enough to gather
enough information if this is the case.

Bug: 1116104
Change-Id: Id0ab1d3ca801196fc49b878349f469cbd4f6e11a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358815Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799827}
parent 6f96a749
......@@ -368,8 +368,15 @@ std::tuple<double, int, bool> AudioBufferSourceHandler::ComputeIndices(
// Final sanity check on buffer access.
// FIXME: as an optimization, try to get rid of this inner-loop check and
// put assertions and guards before the loop.
if (read_index >= buffer_length || read_index2 >= buffer_length)
CHECK_LT(read_index, buffer_length);
CHECK_LT(read_index2, buffer_length);
if (read_index >= buffer_length || read_index2 >= buffer_length) {
// Informs ComputeOutput how many frames we processed so that it only
// processes that many output samples. The read indices and interpolation
// factor are invalid after this point.
frames_processed = k;
break;
}
read0[k] = read_index;
read1[k] = read_index2;
......
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