Commit 8dab8bcb authored by Matt Wolenetz's avatar Matt Wolenetz Committed by Commit Bot

MSE: Remove an AudioDiscardHelper DCHECK hit by imprecise durations

When a decoded audio buffer has an effective front discard that fully
discards the decode output for that buffer, and also has an end discard,
previously this would fail a DCHECK. Release code would fully discard
that buffer, ignore that buffer's end discard, and handle any remaining
front discard in future ProcessBuffer calls.

Since this scenario can happen when the stream's duration metadata is
incorrect relative to the precise decode output (and stream duration
metadata sometimes has limited precision, commonly 1ms in webm), this
change removes the DCHECK, but adds a comment for clarification.

BUG=807515
TEST=associated fuzzer cases no longer fail the DCHECK

Change-Id: Ibb0ec6469fbba0111e20758c485d38778983df23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809101
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697445}
parent 4094084a
...@@ -178,8 +178,10 @@ bool AudioDiscardHelper::ProcessBuffers(const DecoderBuffer& encoded_buffer, ...@@ -178,8 +178,10 @@ bool AudioDiscardHelper::ProcessBuffers(const DecoderBuffer& encoded_buffer,
// If everything would be discarded, indicate a new buffer is required. // If everything would be discarded, indicate a new buffer is required.
if (frames_to_discard == decoded_frames) { if (frames_to_discard == decoded_frames) {
// The buffer should not have been marked with end discard if the front // The buffer should not have been marked with end discard if the front
// discard removes everything. // discard removes everything, though incorrect or imprecise duration
DCHECK(current_discard_padding.second.is_zero()); // metadata, combined with various trimming operations, might still have
// end discard marked here. For simplicity, we do not carry over any such
// end discard for handling later.
return false; return false;
} }
......
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