From 316fd52b78647a0a9ebd750c75fa41b1264899c4 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 26 Sep 2014 15:42:17 +0200 Subject: [PATCH] android/hal-sco: Use hal-utils helpers for unaligned access --- android/hal-sco.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/hal-sco.c b/android/hal-sco.c index 8cb7a7c9d..91a3baf37 100644 --- a/android/hal-sco.c +++ b/android/hal-sco.c @@ -29,7 +29,7 @@ #include #include -#include "../src/shared/util.h" +#include "hal-utils.h" #include "sco-msg.h" #include "ipc-common.h" #include "hal-log.h" @@ -311,10 +311,10 @@ static void downmix_to_mono(struct sco_stream_out *out, const uint8_t *buffer, size_t i; for (i = 0; i < frame_num; i++) { - int16_t l = le16_to_cpu(get_unaligned(&input[i * 2])); - int16_t r = le16_to_cpu(get_unaligned(&input[i * 2 + 1])); + int16_t l = get_le16(&input[i * 2]); + int16_t r = get_le16(&input[i * 2 + 1]); - put_unaligned(cpu_to_le16((l + r) >> 1), &output[i]); + put_le16((l + r) / 2, &output[i]); } } -- 2.47.3