Diff between da50c27b5d3d930f2ece35e417f30e2ead5acd17 and 316fd52b78647a0a9ebd750c75fa41b1264899c4

Changed Files

File Additions Deletions Status
android/hal-sco.c +4 -4 modified

Full Patch

diff --git a/android/hal-sco.c b/android/hal-sco.c
index 8cb7a7c..91a3baf 100644
--- a/android/hal-sco.c
+++ b/android/hal-sco.c
@@ -29,7 +29,7 @@
 #include <hardware/hardware.h>
 #include <audio_utils/resampler.h>
 
-#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]);
 	}
 }