Commit 8a99a0eb authored by Ken MacKay's avatar Ken MacKay Committed by Commit Bot

[Chromecast] Avoid crashing if the AudioProvider returns 0 frames

Change-Id: If7c10365ff4b69c543150cd51dd74a50662bac07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042325Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Commit-Queue: Kenneth MacKay <kmackay@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739190}
parent 4ea7171f
......@@ -152,6 +152,10 @@ AudioClockSimulator::FillResult AudioClockSimulator::FillDataLengthen(
}
int64_t timestamp = playout_timestamp + FramesToMicroseconds(offset);
int provided = provider_->FillFrames(desired_fill, timestamp, channels);
if (provided == 0) {
return {false, 0};
}
input_frames_ += provided;
InterpolateLonger(provided, channel_data, offset);
......
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