CRAS: input_data - Use offset for copy at buffer wrap

When input_data's circular buffer wraps, one buffer copy breaks
into two steps of smaller buffer copy. The second copy needs correct
offset.
Before this fix, there will be 8192/48000= 0.17 seconds periodic
clicking sound due to discontinuity.

BUG=chromium:882742
TEST=cras_test_client --capture_file /tmp/1 --effects aec
to record some loud sound, and listen to the recorded file to
verify there's no periodic clicking sound.

Change-Id: I0e02784ca8ea121768b7a513dbbc5f2733e8c43e
Reviewed-on: https://chromium-review.googlesource.com/1218204
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
1 file changed