Commit 7b895b39 authored by Ken MacKay's avatar Ken MacKay Committed by Chromium LUCI CQ

[Chromecast] Make sure to process audio frames in multiples of 8 in tests

The mixer ensures this in actual operation, and some postprocessors
assume that the frame count is divisible by 8.

Change-Id: I8fb5cd808c0e481f9a19e77c96595023e1320112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616867Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Commit-Queue: Kenneth MacKay <kmackay@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841306}
parent bdbc965e
...@@ -166,7 +166,10 @@ void TestRingingTime(AudioPostProcessor2* pp, ...@@ -166,7 +166,10 @@ void TestRingingTime(AudioPostProcessor2* pp,
int frames_remaining = status.ringing_time_frames; int frames_remaining = status.ringing_time_frames;
int frames_to_process = std::min(frames_remaining, kNumFrames); int frames_to_process = std::min(frames_remaining, kNumFrames);
while (frames_remaining > 0) { while (frames_remaining > 0) {
// Make sure |frames_to_process| is an even multiple of 8.
frames_to_process = std::min(frames_to_process, frames_remaining); frames_to_process = std::min(frames_to_process, frames_remaining);
frames_to_process = (frames_to_process + 7);
frames_to_process -= frames_to_process % 8;
data.assign(frames_to_process * num_input_channels, 0); data.assign(frames_to_process * num_input_channels, 0);
pp->ProcessFrames(data.data(), frames_to_process, &metadata); pp->ProcessFrames(data.data(), frames_to_process, &metadata);
frames_remaining -= frames_to_process; frames_remaining -= frames_to_process;
......
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