CRAS: Format rate_estimator
Reformat codes with the .clang-format we just introduced.
To format whole files provided in-place:
clang-format -i -style=file [<file> ...]
BUG=chromium:950858
TEST=Add directory to check_format_error and run
FEATURES="test" USE=asan emerge-${BOARD} -v media-sound/adhd
Change-Id: I08d1f926881d1bce2ae23cf9e69952062f7cf9d6
Reviewed-on: https://chromium-review.googlesource.com/1640882
Tested-by: En-Shuo Hsu <enshuo@google.com>
Commit-Ready: En-Shuo Hsu <enshuo@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
diff --git a/cras/src/server/rate_estimator.c b/cras/src/server/rate_estimator.c
index e12c0b7..4b1277e 100644
--- a/cras/src/server/rate_estimator.c
+++ b/cras/src/server/rate_estimator.c
@@ -94,12 +94,12 @@
least_square_add_sample(&re->lsq,
td.tv_sec + (double)td.tv_nsec / 1000000000L,
re->window_frames);
- if (timespec_after(&td, &re->window_size) &&
- re->lsq.num_samples > 1) {
+ if (timespec_after(&td, &re->window_size) && re->lsq.num_samples > 1) {
double rate = least_square_best_fit_slope(&re->lsq);
if (fabs(re->estimated_rate - rate) < MAX_RATE_SKEW)
- re->estimated_rate = rate * (1 - re->smooth_factor) +
- re->smooth_factor * re->estimated_rate;
+ re->estimated_rate =
+ rate * (1 - re->smooth_factor) +
+ re->smooth_factor * re->estimated_rate;
least_square_reset(&re->lsq);
re->window_start_ts = *now;
re->window_frames = 0;
diff --git a/cras/src/server/rate_estimator.h b/cras/src/server/rate_estimator.h
index 115c70c..c9a5aff 100644
--- a/cras/src/server/rate_estimator.h
+++ b/cras/src/server/rate_estimator.h
@@ -8,7 +8,6 @@
#include <time.h>
-
/* Hold information to calculate linear least square from
* several (x, y) samples.
*/